[GH-ISSUE #658] trackCount dictionary key from YTMusic.get_playlist returns 1 #441

Closed
opened 2026-02-27 23:00:48 +03:00 by kerem · 1 comment
Owner

Originally created by @ladymileva on GitHub (Oct 7, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/658

Thank you so much for the ytmusicapi, I used it for a script that removes the currently playing song from a playlist.

For one of my playlists (it is working as expected for all the others) the trackCount dictionary key from YTMusic.get_playlist returns 1.

To reproduce:
from ytmusicapi.ytmusic import YTMusic

playlistId = <'id_string'>
playlist = ytmusic.get_playlist(playlistId,None)
trackCount = playlist.get('trackCount')

trackCount always equals 1 for this playlist, even if I specify a value instead of "None" for the number of tracks to retrieve info for.

I can retrieve the proper track count by using:
trackinfo = playlist.get('tracks')
trackCount = len(trackinfo)

I'm not sure why this playlist behaves differently than the others. It may helpful to note that the playlist was created over a year ago, has over 1000 tracks, and the playlistId end with an underscore.

Originally created by @ladymileva on GitHub (Oct 7, 2024). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/658 Thank you so much for the ytmusicapi, I used it for a script that removes the currently playing song from a playlist. For one of my playlists (it is working as expected for all the others) the trackCount dictionary key from YTMusic.get_playlist returns 1. To reproduce: from ytmusicapi.ytmusic import YTMusic <authenticate> playlistId = <'id_string'> playlist = ytmusic.get_playlist(playlistId,None) trackCount = playlist.get('trackCount') trackCount always equals 1 for this playlist, even if I specify a value instead of "None" for the number of tracks to retrieve info for. I can retrieve the proper track count by using: trackinfo = playlist.get('tracks') trackCount = len(trackinfo) I'm not sure why this playlist behaves differently than the others. It may helpful to note that the playlist was created over a year ago, has over 1000 tracks, and the playlistId end with an underscore.
kerem closed this issue 2026-02-27 23:00:48 +03:00
Author
Owner

@sigma67 commented on GitHub (Oct 7, 2024):

this has been fixed already, duplicate of https://github.com/sigma67/ytmusicapi/issues/650

<!-- gh-comment-id:2397443661 --> @sigma67 commented on GitHub (Oct 7, 2024): this has been fixed already, duplicate of https://github.com/sigma67/ytmusicapi/issues/650
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#441
No description provided.