[GH-ISSUE #347] get_playlist(..., limit=track_limit) doesn't return correct length? #272

Closed
opened 2026-02-27 22:08:55 +03:00 by kerem · 4 comments
Owner

Originally created by @dsm-72 on GitHub (Jan 30, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/347

# Get artist data to find their song browseId
artist = ytmusic.get_artist(channelId=YOUTUBE_MUSIC_ARTIST_ID)

# Try and get all song data
yt_songs = ytmusic.get_playlist(playlistId=artist['songs']['browseId'], limit=500, related=False, suggestions_limit=0)

yt_songs['trackCount'], len(yt_songs['tracks'])
# 134, 110

So trackCount isn't the same as len of tracks and there isn't a next page option?

Originally created by @dsm-72 on GitHub (Jan 30, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/347 ```python # Get artist data to find their song browseId artist = ytmusic.get_artist(channelId=YOUTUBE_MUSIC_ARTIST_ID) # Try and get all song data yt_songs = ytmusic.get_playlist(playlistId=artist['songs']['browseId'], limit=500, related=False, suggestions_limit=0) yt_songs['trackCount'], len(yt_songs['tracks']) # 134, 110 ``` So trackCount isn't the same as len of tracks and there isn't a next page option?
kerem closed this issue 2026-02-27 22:08:55 +03:00
Author
Owner

@sigma67 commented on GitHub (Jan 31, 2023):

Normally this shouldn't happen but there's some edge case where it does. Again, please provide the artist id, else I can't reproduce.

<!-- gh-comment-id:1409946121 --> @sigma67 commented on GitHub (Jan 31, 2023): Normally this shouldn't happen but there's some edge case where it does. Again, please provide the artist id, else I can't reproduce.
Author
Owner

@czifumasa commented on GitHub (Jan 31, 2023):

It can occur If you fetch public or unlisted playlist where playlist owner added some uploaded tracks. You don't have access to his uploaded tracks, but they may still be considered for track count.

<!-- gh-comment-id:1409954581 --> @czifumasa commented on GitHub (Jan 31, 2023): It can occur If you fetch public or unlisted playlist where playlist owner added some uploaded tracks. You don't have access to his uploaded tracks, but they may still be considered for track count.
Author
Owner

@dsm-72 commented on GitHub (Jan 31, 2023):

@sigma67 I think it was on id UC4G-AJa7kn8oumI6TT2WXYw during the loop

<!-- gh-comment-id:1410369077 --> @dsm-72 commented on GitHub (Jan 31, 2023): @sigma67 I think it was on id `UC4G-AJa7kn8oumI6TT2WXYw` during the loop
Author
Owner

@sigma67 commented on GitHub (Feb 14, 2023):

@czifumasa this is an artist's songs playlist, so it can't be just some uploaded tracks. However, the artist may be able to set tracks to private, causing this issue. Unfortunately I have no insights on the artists' capabilities here. Either way it's a server-side issue, not a ytmusicapi one, as the server is only returning 129 tracks either way.

https://music.youtube.com/playlist?list=OLAK5uy_lihhm8an0pBrQ_rMaHTryX6-tYH1OTuCQ

<!-- gh-comment-id:1430476426 --> @sigma67 commented on GitHub (Feb 14, 2023): @czifumasa this is an artist's songs playlist, so it can't be just some uploaded tracks. However, the artist may be able to set tracks to private, causing this issue. Unfortunately I have no insights on the artists' capabilities here. Either way it's a server-side issue, not a ytmusicapi one, as the server is only returning 129 tracks either way. https://music.youtube.com/playlist?list=OLAK5uy_lihhm8an0pBrQ_rMaHTryX6-tYH1OTuCQ
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#272
No description provided.