mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-04 05:52:24 +08:00
Fixed JSON parsing exception in supersubtitles provider. #1700
This commit is contained in:
parent
6b36920b1c
commit
83e36e4c1c
1 changed files with 6 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue