Skip to content

Commit 1659fe6

Browse files
author
PhYrE
committed
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.
1 parent 5da27d3 commit 1659fe6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

zotify/playlist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def get_playlist_info(playlist_id):
4949
def download_playlist(playlist):
5050
"""Downloads all the songs from a playlist"""
5151

52-
playlist_songs = [song for song in get_playlist_songs(playlist[ID]) if song[TRACK][ID]]
52+
playlist_songs = [song for song in get_playlist_songs(playlist[ID]) if song[TRACK] is not None and song[TRACK][ID]]
5353
p_bar = Printer.progress(playlist_songs, unit='song', total=len(playlist_songs), unit_scale=True)
5454
enum = 1
5555
for song in p_bar:

0 commit comments

Comments
 (0)