summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJayZed <[email protected]>2024-10-19 20:12:37 -0400
committerGitHub <[email protected]>2024-10-19 20:12:37 -0400
commit092012a48715fd65184cef5e623bfb60f6d01543 (patch)
tree15c2a523246424656c86da979e7f5918e19f0aeb
parent1874f29789aa574c867ff279892db12ae154e6cf (diff)
downloadbazarr-092012a48715fd65184cef5e623bfb60f6d01543.tar.gz
bazarr-092012a48715fd65184cef5e623bfb60f6d01543.zip
Fixed RegieLive JSONDecodeError #2727v1.4.6-beta.8
-rw-r--r--custom_libs/subliminal_patch/providers/regielive.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/custom_libs/subliminal_patch/providers/regielive.py b/custom_libs/subliminal_patch/providers/regielive.py
index d20972f03..8c7363bf0 100644
--- a/custom_libs/subliminal_patch/providers/regielive.py
+++ b/custom_libs/subliminal_patch/providers/regielive.py
@@ -92,17 +92,19 @@ class RegieLiveProvider(Provider):
data=payload, headers=self.headers)
subtitles = []
- if response.json()['cod'] == 200:
- results_subs = response.json()['rezultate']
- for film in results_subs:
- for sub in results_subs[film]['subtitrari']:
- subtitles.append(
- RegieLiveSubtitle(
- results_subs[film]['subtitrari'][sub]['titlu'],
- video,
- results_subs[film]['subtitrari'][sub]['url'],
- results_subs[film]['subtitrari'][sub]['rating']['nota'],
- language))
+ if response.status_code == 200:
+ results = response.json()
+ if len(results) > 0:
+ results_subs = results['rezultate']
+ for film in results_subs:
+ for sub in results_subs[film]['subtitrari']:
+ subtitles.append(
+ RegieLiveSubtitle(
+ results_subs[film]['subtitrari'][sub]['titlu'],
+ video,
+ results_subs[film]['subtitrari'][sub]['url'],
+ results_subs[film]['subtitrari'][sub]['rating']['nota'],
+ language))
return subtitles
def list_subtitles(self, video, languages):