diff options
author | Bogdan Ilisei <[email protected]> | 2021-02-25 13:37:03 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-25 06:37:03 -0500 |
commit | d0f50a2e99d8e13e3ab0c406f26e7ebfa0d3cf95 (patch) | |
tree | 30a6d627a25f10ecf6523060056da21210b02387 /libs | |
parent | ef8c4a43d4a633acd314ac619936a919b60345ec (diff) | |
download | bazarr-d0f50a2e99d8e13e3ab0c406f26e7ebfa0d3cf95.tar.gz bazarr-d0f50a2e99d8e13e3ab0c406f26e7ebfa0d3cf95.zip |
Improved RegieLive.ro to not get throttled when there are no results (#1293)
Diffstat (limited to 'libs')
-rw-r--r-- | libs/subliminal_patch/providers/regielive.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/subliminal_patch/providers/regielive.py b/libs/subliminal_patch/providers/regielive.py index bc8a0ded9..706ba0e46 100644 --- a/libs/subliminal_patch/providers/regielive.py +++ b/libs/subliminal_patch/providers/regielive.py @@ -120,11 +120,11 @@ class RegieLiveProvider(Provider): payload['an'] = video.year response = self.session.post(self.url, data=payload, headers=self.headers) logger.info(response.json()) - response_json = response.json()['rezultate'] subtitles = [] - if not 'eroare' in response_json: - for film in response_json: - for sub in response_json[film]['subtitrari']: + if response.json()['cod'] == '200': + results_subs = response.json()['rezultate'] + for film in results_subs: + for sub in results_subs[film]['subtitrari']: logger.debug(sub) subtitles.append( RegieLiveSubtitle(sub['titlu'], video, sub['url'], sub['rating'], language) |