Added check if 'code' is in error obj

This commit is contained in:
RemixDev 2020-06-18 17:03:16 +02:00
parent 2cce36f82d
commit c8875483bc
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
setup( setup(
name="deemix", name="deemix",
version="1.0.21", version="1.0.22",
description="A barebone deezer downloader library", description="A barebone deezer downloader library",
long_description=README, long_description=README,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",