Added wait and retry for "Quota limit exceeded"

This fixes #30
This commit is contained in:
RemixDev 2020-06-12 10:15:47 +02:00
parent 8673084639
commit be93716993
1 changed files with 3 additions and 0 deletions

View File

@ -92,6 +92,9 @@ class Deezer:
time.sleep(2)
return self.api_call(method, args)
if 'error' in result_json.keys():
if result_json['error']['code'] == 4:
time.sleep(5)
return self.api_call(method, args)
raise APIError(result_json)
return result_json