From dae68d7e8b5968b79855a5c840f5fbae7fc0ab06 Mon Sep 17 00:00:00 2001 From: German Gutierrez Date: Fri, 8 May 2020 13:57:42 +0200 Subject: [PATCH] betaseries: logging 404 errors instead of raising --- libs/subliminal_patch/providers/betaseries.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/subliminal_patch/providers/betaseries.py b/libs/subliminal_patch/providers/betaseries.py index 7115ada5e..41a48291c 100644 --- a/libs/subliminal_patch/providers/betaseries.py +++ b/libs/subliminal_patch/providers/betaseries.py @@ -139,7 +139,12 @@ class BetaSeriesProvider(Provider): def download_subtitle(self, subtitle): logger.info('Downloading subtitle %r', subtitle) 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) if archive: @@ -153,7 +158,7 @@ class BetaSeriesProvider(Provider): if subtitle_content: subtitle.content = fix_line_ending(subtitle_content) else: - logger.debug('Could not extract subtitle from %r', archive) + logger.error('Could not extract subtitle from %r', archive) def _get_archive(content):