Fixed RegieLive JSONDecodeError #2727

pull/2733/head v1.4.6-beta.8
JayZed 1 month ago committed by GitHub
parent 1874f29789
commit 092012a487
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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):

Loading…
Cancel
Save