|
|
@ -139,6 +139,11 @@ class BetaSeriesProvider(Provider):
|
|
|
|
def download_subtitle(self, subtitle):
|
|
|
|
def download_subtitle(self, subtitle):
|
|
|
|
logger.info('Downloading subtitle %r', subtitle)
|
|
|
|
logger.info('Downloading subtitle %r', subtitle)
|
|
|
|
r = self.session.get(subtitle.download_link, timeout=10)
|
|
|
|
r = self.session.get(subtitle.download_link, timeout=10)
|
|
|
|
|
|
|
|
print('STATUS %s' % r.status_code)
|
|
|
|
|
|
|
|
if r.status_code == 404:
|
|
|
|
|
|
|
|
logger.error('Error 404 downloading %r', subtitle)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
else:
|
|
|
|
r.raise_for_status()
|
|
|
|
r.raise_for_status()
|
|
|
|
|
|
|
|
|
|
|
|
archive = _get_archive(r.content)
|
|
|
|
archive = _get_archive(r.content)
|
|
|
@ -153,7 +158,7 @@ class BetaSeriesProvider(Provider):
|
|
|
|
if subtitle_content:
|
|
|
|
if subtitle_content:
|
|
|
|
subtitle.content = fix_line_ending(subtitle_content)
|
|
|
|
subtitle.content = fix_line_ending(subtitle_content)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
logger.debug('Could not extract subtitle from %r', archive)
|
|
|
|
logger.error('Could not extract subtitle from %r', archive)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _get_archive(content):
|
|
|
|
def _get_archive(content):
|
|
|
|