mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #436] get_charts is having KeyError #327
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#327
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 @ankydv on GitHub (Sep 23, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/436
[1.2.1/1.1.1] get_charts is having KeyError: -
To Reproduce
Steps to reproduce the behavior:
Additional context
With some analysis I've figured out that youtube returns different response for different videos.
It appears to only occurs in 'videos' section. Not 'trending'.
**Cause
The NAVIGATION_VIDEO_ID in navigation.py is not sufficient to cover all types of responses from Youtube as the reponse of Youtube is inconsistent.
Expected structure of response:-
In some cases, the response is like: -
Possible solution
In those cases, the video ID exists somewhere else, not in 'navigationEndpoint', the navigation should be like: -
NAVIGATION_VIDEO_ID_2 = ['menu','menuRenderer','items',0,'menuServiceItemRenderer','serviceEndpoint','queueAddEndpoint','queueTarget','videoId']
Hence we could fix it by excepting the KeyError with this nav instead.
Error.txt
@sigma67 commented on GitHub (Sep 23, 2023):
Which region are you looking at? Please specify the failing call in more detail. If it's the default region for you please figure out which one that is.
@ankydv commented on GitHub (Sep 23, 2023):
I checked for default region as well as my region ('IN"). In both the cases there was the same issue. You could look the 'Error.txt' file that I have already dropped.
@Arnav717 commented on GitHub (Sep 24, 2023):
I am also facing the same issue,
for "ZZ" region as well as for "IN" region its giving keyError.
@ankydv commented on GitHub (Sep 25, 2023):
I've the solution, I could raise a pull request.
@Arnav717 commented on GitHub (Sep 25, 2023):
Yes please PR it
also whats the solution to this?
@ankydv commented on GitHub (Sep 25, 2023):
I've Created a PR. You could view it.