betaseries: logging 404 errors instead of raising

pull/1014/head
German Gutierrez 5 years ago
parent ea792a09f1
commit dae68d7e8b

@ -139,7 +139,12 @@ 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)
r.raise_for_status() print('STATUS %s' % r.status_code)
if r.status_code == 404:
logger.error('Error 404 downloading %r', subtitle)
return
else:
r.raise_for_status()
archive = _get_archive(r.content) archive = _get_archive(r.content)
if archive: if archive:
@ -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):

Loading…
Cancel
Save