Fixed media key error

This commit is contained in:
RemixDev 2021-09-25 08:52:20 +02:00
parent 55328e857b
commit 2bc2b3fd41
No known key found for this signature in database
GPG key ID: B33962B465BDB51C

View file

@ -183,7 +183,7 @@ class Deezer:
result.append(WrongGeolocation(self.current_user['country']))
else:
result.append(DeezerError(json.dumps(response)))
if data['media']:
if 'media' in data:
result.append(data['media'][0]['sources'][0]['url'])
else:
result.append(None)