mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #799] Intermittent KeyError: "Unable to find 'header' using path [...] #502
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#502
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 @Silverarmor on GitHub (Aug 16, 2025).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/799
Hiya - I'm one of the spotDL devs. We've been facing a very intermittent issue where ytmusicapi returns a KeyError every now and then. I assume it may be to do with YT's API but you guys are the experts.
The issue occurs when running
YTMusic.search("a"). Every now and then it will return a keyerror, caught here:github.com/sigma67/ytmusicapi@f6295e50be/ytmusicapi/navigation.py (L123-L127)ytmusicapi version
1.11.0
To Reproduce
Additional context
It's super intermittent. At first, users reported it but I couldn't reproduce. Then one day suddenly it started happening to me lol. issue tracked at https://github.com/spotDL/spotify-downloader/issues/2438 for us.
@sigma67 commented on GitHub (Aug 16, 2025):
So basically it expects the
headerkey to exist. Which usually it does - it's the part that states "Top result" at the top of the results page.In your data, the
headerkey is completely missing. I do wonder what the page would look like in that case - but I guess the JS on the page is able to handle it, so we should as well.@sigma67 commented on GitHub (Aug 16, 2025):
I have pushed a fix to the linked PR. Please test it since I cannot reproduce the issue. I hope it doesn't fail at a later point due to the header expected to be present..
@astonm commented on GitHub (Aug 16, 2025):
I ran into the same
KeyErrorand can verify the patch in93523b5works for me. Thanks!@Silverarmor commented on GitHub (Aug 17, 2025):
Thanks. I'll test on the PR. The issue was very intermittent and only randomly showed up (I struggled to reproduce it for a few days).
@Silverarmor commented on GitHub (Aug 30, 2025):
Hi @sigma67, when can we expect next version to be released?
@sigma67 commented on GitHub (Aug 30, 2025):
@Silverarmor 1.11.1 created
@Silverarmor commented on GitHub (Aug 31, 2025):
Thanks!