From 2780ba405fc64a1574f413037842f2c37d68740d Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Fri, 27 Oct 2017 14:37:26 +0530 Subject: [PATCH] Catch only IndexError --- spotdl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spotdl.py b/spotdl.py index 79bc17a..932a36d 100755 --- a/spotdl.py +++ b/spotdl.py @@ -30,7 +30,7 @@ def generate_metadata(raw_song): # otherwise search on spotify and fetch information from first result try: meta_tags = spotify.search(raw_song, limit=1)['tracks']['items'][0] - except: + except IndexError: return None artist = spotify.artist(meta_tags['artists'][0]['id']) album = spotify.album(meta_tags['album']['id'])