1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2025-03-01 00:55:52 +00:00

Improved RegieLive.ro to not get throttled when there are no results (#1293)

This commit is contained in:
Bogdan Ilisei 2021-02-25 13:37:03 +02:00 committed by GitHub
parent ef8c4a43d4
commit d0f50a2e99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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