[GH-ISSUE #25] get_playlist with over 1,000 songs valueerror exception #17

Closed
opened 2026-02-27 22:07:34 +03:00 by kerem · 1 comment
Owner

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'

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 <module> 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'
kerem closed this issue 2026-02-27 22:07:34 +03:00
Author
Owner

@sigma67 commented on GitHub (May 25, 2020):

Good catch! And simple to fix as well as you pointed out.

<!-- gh-comment-id:633624187 --> @sigma67 commented on GitHub (May 25, 2020): Good catch! And simple to fix as well as you pointed out.
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#17
No description provided.