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.
This commit is contained in:
PhYrE 2024-04-24 01:38:05 +02:00
parent 5da27d32a1
commit 1659fe667e

View file

@ -49,7 +49,7 @@ def get_playlist_info(playlist_id):
def download_playlist(playlist): def download_playlist(playlist):
"""Downloads all the songs from a 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) p_bar = Printer.progress(playlist_songs, unit='song', total=len(playlist_songs), unit_scale=True)
enum = 1 enum = 1
for song in p_bar: for song in p_bar: