Skip to content

Commit

Permalink
Fixed JSON parsing exception in supersubtitles provider. #1700
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Jan 30, 2022
1 parent 6b36920 commit 83e36e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/subliminal_patch/providers/supersubtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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

Expand Down Expand Up @@ -383,7 +384,11 @@ def get_subtitle_list(self, series_id, season, episode, video):
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:
Expand Down

0 comments on commit 83e36e4

Please sign in to comment.