From cd6c527d89e4ea660677909586a54e2c9ddcd151 Mon Sep 17 00:00:00 2001 From: josdion Date: Tue, 14 Apr 2020 09:40:37 +0300 Subject: [PATCH] FIx #928 - don't raise an exception in case of unsupported archive --- libs/subliminal_patch/providers/subssabbz.py | 3 ++- libs/subliminal_patch/providers/subsunacs.py | 3 ++- libs/subliminal_patch/providers/yavkanet.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/subliminal_patch/providers/subssabbz.py b/libs/subliminal_patch/providers/subssabbz.py index f2bb05450..de93e47b3 100644 --- a/libs/subliminal_patch/providers/subssabbz.py +++ b/libs/subliminal_patch/providers/subssabbz.py @@ -188,4 +188,5 @@ class SubsSabBzProvider(Provider): elif is_zipfile(archive_stream): return self.process_archive_subtitle_files( ZipFile(archive_stream), language, video, link ) else: - raise ValueError('Not a valid archive') + logger.error('Ignore unsupported archive %r', request.headers) + return [] diff --git a/libs/subliminal_patch/providers/subsunacs.py b/libs/subliminal_patch/providers/subsunacs.py index 87c97c486..e3237b80b 100644 --- a/libs/subliminal_patch/providers/subsunacs.py +++ b/libs/subliminal_patch/providers/subsunacs.py @@ -196,4 +196,5 @@ class SubsUnacsProvider(Provider): elif is_zipfile(archive_stream): return self.process_archive_subtitle_files( ZipFile(archive_stream), language, video, link ) else: - raise ValueError('Not a valid archive') + logger.error('Ignore unsupported archive %r', request.headers) + return [] diff --git a/libs/subliminal_patch/providers/yavkanet.py b/libs/subliminal_patch/providers/yavkanet.py index d695245ee..1ea0d2ca0 100644 --- a/libs/subliminal_patch/providers/yavkanet.py +++ b/libs/subliminal_patch/providers/yavkanet.py @@ -175,5 +175,5 @@ class YavkaNetProvider(Provider): elif is_zipfile(archive_stream): return self.process_archive_subtitle_files( ZipFile(archive_stream), language, video, link ) else: - raise ValueError('Not a valid archive') - + logger.error('Ignore unsupported archive %r', request.headers) + return []