mirror of
https://gitlab.com/RemixDev/deezer-py.git
synced 2025-01-15 02:55:20 +00:00
fixed "list index out of range" error when getting track url
This commit is contained in:
parent
d6a0cb2c74
commit
3f558db4ab
|
@ -190,7 +190,7 @@ class Deezer:
|
||||||
result.append(WrongGeolocation(self.current_user['country']))
|
result.append(WrongGeolocation(self.current_user['country']))
|
||||||
else:
|
else:
|
||||||
result.append(DeezerError(json.dumps(response)))
|
result.append(DeezerError(json.dumps(response)))
|
||||||
if 'media' in data:
|
if 'media' in data and len(data['media']):
|
||||||
result.append(data['media'][0]['sources'][0]['url'])
|
result.append(data['media'][0]['sources'][0]['url'])
|
||||||
else:
|
else:
|
||||||
result.append(None)
|
result.append(None)
|
||||||
|
|
Loading…
Reference in a new issue