mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 15:26:01 +03:00
[GH-ISSUE #25] get_playlist with over 1,000 songs valueerror exception #17
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#17
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 @hibby50 on GitHub (May 25, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/25
Hey, thanks for this awesome API, I'm using it to write some simple scripts for my library. I ran into an issue when I tried to run get_playlist() on a pl with >1,000 songs. Looks like the comma needs to be stripped out of the song count.
Traceback (most recent call last):
File "simple-playlist-maker.py", line 38, in
pl_tracks = ytmusic.get_playlist(playlist, 9999)["tracks"]
File "/home/hibby/.local/lib/python3.8/site-packages/ytmusicapi/ytmusic.py", line 732, in get_playlist
song_count = int(header['secondSubtitle']['runs'][0]['text'].split(' ')[0])
ValueError: invalid literal for int() with base 10: '1,149'
@sigma67 commented on GitHub (May 25, 2020):
Good catch! And simple to fix as well as you pointed out.