Skip to content

Commit

Permalink
Fix get_playlist_items for empty playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Feb 23, 2020
1 parent 9ef92f8 commit 49c4821
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ytmusicapi/ytmusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ def get_playlist_items(self, playlistId, limit=1000):
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
Expand Down

0 comments on commit 49c4821

Please sign in to comment.