diff --git a/ytmusicapi/ytmusic.py b/ytmusicapi/ytmusic.py index b9a46f6e..37e8d0ca 100644 --- a/ytmusicapi/ytmusic.py +++ b/ytmusicapi/ytmusic.py @@ -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