Fix get_playlist_items for empty playlist

This commit is contained in:
sigma67 2020-02-23 17:54:50 +01:00
commit 49c4821813
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0

View file

@ -244,6 +244,9 @@ class YTMusic:
else:
header = response['header']['musicEditablePlaylistDetailHeaderRenderer']['header']['musicDetailHeaderRenderer']
song_count = int(header['secondSubtitle']['runs'][0]['text'].split(' ')[0])
if song_count == 0:
return songs
songs_to_get = min(limit, song_count)
songs.extend(parse_songs(results['contents']))
request_count = 1