Fixed get_tracks_url when tracks are not released yet

This commit is contained in:
RemixDev 2021-07-25 15:23:32 +02:00
parent 1231ca0685
commit 185c9c81b9
No known key found for this signature in database
GPG key ID: B33962B465BDB51C

View file

@ -164,4 +164,6 @@ class Deezer:
except requests.exceptions.HTTPError:
return None
return response['data'][0]['media'][0]['sources'][0]['url']
if response.get('data') and response['data'][0].get('media'):
return response['data'][0]['media'][0]['sources'][0]['url']
return None