mirror of
https://gitlab.com/RemixDev/deezer-py.git
synced 2025-01-01 12:26:06 +00:00
Fixed error key issue
This commit is contained in:
parent
7fac125896
commit
e371c32d3a
|
@ -147,7 +147,7 @@ class Deezer:
|
||||||
track_tokens = [track_tokens, ]
|
track_tokens = [track_tokens, ]
|
||||||
if not self.current_user['license_token']:
|
if not self.current_user['license_token']:
|
||||||
return None
|
return None
|
||||||
if track_format == "FLAC" and not self.current_user.can_stream_lossless or format == "MP3_320" and not self.current_user.can_stream_hq:
|
if track_format == "FLAC" and not self.current_user['can_stream_lossless'] or format == "MP3_320" and not self.current_user['can_stream_hq']:
|
||||||
raise WrongLicense(format)
|
raise WrongLicense(format)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -171,7 +171,7 @@ class Deezer:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if len(response.get('data', [])):
|
if len(response.get('data', [])):
|
||||||
if response['data'][0]['errors']:
|
if 'errors' in response['data'][0]:
|
||||||
if response['data'][0]['errors'][0]['code'] == 2002:
|
if response['data'][0]['errors'][0]['code'] == 2002:
|
||||||
raise WrongGeolocation(self.current_user.country)
|
raise WrongGeolocation(self.current_user.country)
|
||||||
raise DeezerError(json.dumps(response))
|
raise DeezerError(json.dumps(response))
|
||||||
|
|
Loading…
Reference in a new issue