From dae68d7e8b5968b79855a5c840f5fbae7fc0ab06 Mon Sep 17 00:00:00 2001 From: German Gutierrez Date: Fri, 8 May 2020 13:57:42 +0200 Subject: [PATCH 1/2] 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): From fda6b5ef014e5893fa299e9b17d688a968d11d03 Mon Sep 17 00:00:00 2001 From: German Gutierrez Date: Fri, 8 May 2020 14:08:17 +0200 Subject: [PATCH 2/2] betaseries: removing print line used for debug --- libs/subliminal_patch/providers/betaseries.py | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/subliminal_patch/providers/betaseries.py b/libs/subliminal_patch/providers/betaseries.py index 41a48291c..f4c769293 100644 --- a/libs/subliminal_patch/providers/betaseries.py +++ b/libs/subliminal_patch/providers/betaseries.py @@ -139,7 +139,6 @@ class BetaSeriesProvider(Provider): def download_subtitle(self, subtitle): logger.info('Downloading subtitle %r', subtitle) 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