mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #551] KeyError: 'musicResponsiveListItemRenderer' When Calling get_charts with Non-Global Country Codes #389
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#389
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 @PelicanSL on GitHub (Feb 21, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/551
Description
When using the get_charts method from ytmusicapi, specifying the global country code "ZZ" works as expected and returns chart data without issues. However, attempting to use any other country code (e.g., "ES", "US", "FR", "EN") results in a KeyError for 'musicResponsiveListItemRenderer'. This issue occurs across different country codes, suggesting a problem with handling responses for specific countries other than the global charts.
To Reproduce:
Steps to reproduce the behavior:
Expected Behavior:
The expected behavior is for the get_charts method to return chart data for the specified country without raising an error, similar to how it behaves with the global country code "ZZ".
Actual Behavior:
A KeyError is raised for 'musicResponsiveListItemRenderer', indicating a failure to parse the API response for non-global country codes.
Error Message:
Additional Context:
Code Sample:
I have the library updated to version 1.5.2, and the issue persists across various non-global country codes, indicating a broader problem with handling country-specific chart data.
Thanks!!
@sigma67 commented on GitHub (Feb 22, 2024):
This is hard to debug without the actual JSON data being returned for you. You can retrieve it via the POST requests when navigating to the charts page on YouTube Music.
Screenshots may help as well.
I know YouTube Music has been doing A/B tests lately on that page because I've been affected as well (the Trending category stopped showing up for a while, but now it's back).
@fischcode commented on GitHub (Feb 23, 2024):
I can confirm this issue with ytmusicapi 1.5.2.; As the issue does not appear in branch fix-548 it appears to have been caused by the modifications in ytmusic 1.5.2 which have been reverted in that branch.
@sigma67 commented on GitHub (Feb 24, 2024):
@PelicanSL can you check with 1.5.3 and close if fixed?