mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #658] trackCount dictionary key from YTMusic.get_playlist returns 1 #441
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#441
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@sigma67 commented on GitHub (Oct 7, 2024):
this has been fixed already, duplicate of https://github.com/sigma67/ytmusicapi/issues/650