diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2024-12-24 15:19:09 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-24 15:19:09 +0000 |
commit | 6ec304d13d5ed8a217f0f6d6ee98ecc98cac87af (patch) | |
tree | bb37288a8dba25f485c5b763098afb848a0a9669 /custom_libs/subliminal_patch/providers/regielive.py | |
parent | d6b74c908353c5051e188565e01b686a7017c3e9 (diff) | |
parent | 2247c55bfa9fd38bf3fbe80330a5c37f4988ee6a (diff) | |
download | bazarr-master.tar.gz bazarr-master.zip |
Diffstat (limited to 'custom_libs/subliminal_patch/providers/regielive.py')
-rw-r--r-- | custom_libs/subliminal_patch/providers/regielive.py | 24 |
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): |