diff options
author | JayZed <[email protected]> | 2024-10-25 11:42:15 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-25 11:42:15 -0400 |
commit | 239ab780eb5c3006ce28a45eb5bf2c7eb65d56ad (patch) | |
tree | 8e0362c647f83a02d145276c044ccac144059e47 | |
parent | c615f99f0635ab57e0de1015e4e4575821c074aa (diff) | |
download | bazarr-239ab780eb5c3006ce28a45eb5bf2c7eb65d56ad.tar.gz bazarr-239ab780eb5c3006ce28a45eb5bf2c7eb65d56ad.zip |
Handle bad JSON results from subsynchro provider #2735v1.4.6-beta.12
-rw-r--r-- | custom_libs/subliminal_patch/providers/subsynchro.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/custom_libs/subliminal_patch/providers/subsynchro.py b/custom_libs/subliminal_patch/providers/subsynchro.py index e05e7c4e7..9e3c629ec 100644 --- a/custom_libs/subliminal_patch/providers/subsynchro.py +++ b/custom_libs/subliminal_patch/providers/subsynchro.py @@ -6,6 +6,7 @@ import os from zipfile import ZipFile, is_zipfile from requests import Session from guessit import guessit +from requests.exceptions import JSONDecodeError from subliminal import Movie from subliminal.subtitle import SUBTITLE_EXTENSIONS, fix_line_ending @@ -91,7 +92,11 @@ class SubsynchroProvider(Provider): result.raise_for_status() subtitles = [] - results = result.json() or {} + + try: + results = result.json() + except JSONDecodeError: + results = {} status_ = results.get("status") |