From 3f558db4abd990356ed5c4996e339a61eb24bec2 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 19 Dec 2021 18:07:10 +0100 Subject: [PATCH] fixed "list index out of range" error when getting track url --- deezer/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deezer/__init__.py b/deezer/__init__.py index a4c527f..0832c66 100644 --- a/deezer/__init__.py +++ b/deezer/__init__.py @@ -190,7 +190,7 @@ class Deezer: result.append(WrongGeolocation(self.current_user['country'])) else: 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']) else: result.append(None)