From 1659fe667e22fc552f0c2f657e6fa3169c61e325 Mon Sep 17 00:00:00 2001 From: PhYrE Date: Wed, 24 Apr 2024 01:38:05 +0200 Subject: [PATCH] Don't crash out if a user includes an episode/podcast in a playlist. Previously, "'NoneType' object is not subscriptable" happened on certain playlists where the playlist includes a podcast episode or other non-track content. This checks it and skips over in such a case. --- zotify/playlist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zotify/playlist.py b/zotify/playlist.py index 53c1941..919c47b 100644 --- a/zotify/playlist.py +++ b/zotify/playlist.py @@ -49,7 +49,7 @@ def get_playlist_info(playlist_id): def download_playlist(playlist): """Downloads all the songs from a playlist""" - playlist_songs = [song for song in get_playlist_songs(playlist[ID]) if song[TRACK][ID]] + playlist_songs = [song for song in get_playlist_songs(playlist[ID]) if song[TRACK] is not None and song[TRACK][ID]] p_bar = Printer.progress(playlist_songs, unit='song', total=len(playlist_songs), unit_scale=True) enum = 1 for song in p_bar: