summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-01-30 11:21:11 -0500
committermorpheus65535 <[email protected]>2022-01-30 11:21:11 -0500
commit83e36e4c1c58a73966e4d0f924e071b73e8e00ec (patch)
treefa69a010153c17d8bb79bd9fe7a50f7e5778fdd7
parent6b36920b1c54c9249a4f4ee71b080aac04b17dec (diff)
downloadbazarr-83e36e4c1c58a73966e4d0f924e071b73e8e00ec.tar.gz
bazarr-83e36e4c1c58a73966e4d0f924e071b73e8e00ec.zip
Fixed JSON parsing exception in supersubtitles provider. #1700v1.0.3-beta.22
-rw-r--r--libs/subliminal_patch/providers/supersubtitles.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/subliminal_patch/providers/supersubtitles.py b/libs/subliminal_patch/providers/supersubtitles.py
index abf8f1161..05362f2bf 100644
--- a/libs/subliminal_patch/providers/supersubtitles.py
+++ b/libs/subliminal_patch/providers/supersubtitles.py
@@ -7,6 +7,7 @@ import time
from babelfish import language_converters
from subzero.language import Language
from requests import Session
+from requests.exceptions import JSONDecodeError
import urllib.parse
from random import randint
@@ -383,7 +384,11 @@ class SuperSubtitlesProvider(Provider, ProviderSubtitleArchiveMixin):
if episode:
url += "&rtol=" + str(episode)
- results = self.session.get(url, timeout=10).json()
+ try:
+ results = self.session.get(url, timeout=10).json()
+ except JSONDecodeError:
+ # provider returned improper JSON
+ results = None
'''
The result will be a JSON like this: