mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #604] keyError when using get_playlist() #415
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#415
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 @soreikomori on GitHub (Jun 21, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/604
Describe the bug
When attempting to run
yt.get_playlist(), the program goes through all of the steps until it lands in line 97 of navigation.py, where it errors out:Just a moment ago, YTM seems to have pushed an update that makes playlists look different on browser. This random change might have caused some internal issue in the Google TV API that ytmusicapi fails to handle appropriately.
To Reproduce
Steps to reproduce the behavior:
yt.get_playlist(), for example by runningyt.get_playlist(id, None)where id is the ID of a playlist (string).Additional context
Here's how the entire error looks like for me.
@sigma67 commented on GitHub (Jun 21, 2024):
Can you please provide screenshots of the playlist format and response data (copy JSON response from network requests tab, from request to the playlist endpoint)
@scrimshander commented on GitHub (Jun 21, 2024):
I am a different user but exact same error. Playlist response JSON is attached. Not sure exactly what you are looking for re screenshot but I've attached the playlist page as it appears.
playlist_response.json
@sigma67 commented on GitHub (Jun 21, 2024):
Please tell which version of ytmusicapi you are using in case it isn't latest
@scrimshander commented on GitHub (Jun 21, 2024):
I was using 1.3.0 for the above. Didn't realize I was so far out of date. I just upgraded and am dealing with an issue that must be in my code but I will try to get it working and see what happens with the latest version.
@JohnHKoh commented on GitHub (Jun 21, 2024):
Ran into the same issue using 0.25.2. Updated to the latest version (1.7.3) and now receiving the following error:
and
@soreikomori commented on GitHub (Jun 21, 2024):
I tried on 1.5.2 and 1.6.0 and got the same error on both. Upgrading to 1.7.3 seems to have fixed it fortunately. I'll leave the issue open for now though given what @JohnHKoh reported above.
@JohnHKoh commented on GitHub (Jun 21, 2024):
github.com/sigma67/ytmusicapi@11823d6387/ytmusicapi/mixins/playlists.py (L214-L215)These seem to be the offending lines. I don't know what it looked like before, but
second_subtitle_runs[has_views + 0]["text"]is "트랙 100개". Thereforesong_count[0]now returns "트랙" (track) instead of "100개". This seems to be a localization issue, as when I change the language from Korean ("ko") to English ("en"),second_subtitle_runs[has_views + 0]["text"]is "100 tracks", and sosong_count[0]now gets the correct value.The code will need to be updated to extract the number from this string.
@sigma67 commented on GitHub (Jun 21, 2024):
I'm impressed that there are still people on 0.25. As it's fixed on latest I will close this thread.
@sigma67 commented on GitHub (Jun 21, 2024):
@JohnHKoh please create a separate issue as it is likely not directly related