[GH-ISSUE #216] Cannot get album, where is my mistake #166

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

Originally created by @TheDhafi on GitHub (Aug 5, 2021).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/216

C:\Users\TheDhafi>python ytdata.py Traceback (most recent call last): File "C:\Users\TheDhafi\ytdata.py", line 4, in <module> search_results = ytmusic.get_album("VLPLyptEKnOyi5Ci9jF22vECiU5f-FNuMBwB") File "C:\Users\TheDhafi\AppData\Local\Programs\Python\Python39\lib\site-packages\ytmusicapi\mixins\browsing.py", line 464, in get_album results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + MUSIC_SHELF) File "C:\Users\TheDhafi\AppData\Local\Programs\Python\Python39\lib\site-packages\ytmusicapi\parsers\utils.py", line 155, in nav raise err File "C:\Users\TheDhafi\AppData\Local\Programs\Python\Python39\lib\site-packages\ytmusicapi\parsers\utils.py", line 149, in nav root = root[k] KeyError: 'musicShelfRenderer'

hello owner, sorry I'm a bit of a newbie about programming code problems. I tried your PX, but I got the error as above. with the python command below:

`from ytmusicapi import YTMusic
ytmusic = YTMusic('headers_auth.json')
search_results = ytmusic.get_album("VLPLyptEKnOyi5Ci9jF22vECiU5f-FNuMBwB")
print(search_results);

`where is my mistake?

Originally created by @TheDhafi on GitHub (Aug 5, 2021). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/216 `C:\Users\TheDhafi>python ytdata.py Traceback (most recent call last): File "C:\Users\TheDhafi\ytdata.py", line 4, in <module> search_results = ytmusic.get_album("VLPLyptEKnOyi5Ci9jF22vECiU5f-FNuMBwB") File "C:\Users\TheDhafi\AppData\Local\Programs\Python\Python39\lib\site-packages\ytmusicapi\mixins\browsing.py", line 464, in get_album results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + MUSIC_SHELF) File "C:\Users\TheDhafi\AppData\Local\Programs\Python\Python39\lib\site-packages\ytmusicapi\parsers\utils.py", line 155, in nav raise err File "C:\Users\TheDhafi\AppData\Local\Programs\Python\Python39\lib\site-packages\ytmusicapi\parsers\utils.py", line 149, in nav root = root[k] KeyError: 'musicShelfRenderer'` hello owner, sorry I'm a bit of a newbie about programming code problems. I tried your PX, but I got the error as above. with the python command below: `from ytmusicapi import YTMusic ytmusic = YTMusic('headers_auth.json') search_results = ytmusic.get_album("VLPLyptEKnOyi5Ci9jF22vECiU5f-FNuMBwB") print(search_results); `where is my mistake?
kerem closed this issue 2026-02-27 22:08:24 +03:00
Author
Owner
<!-- gh-comment-id:900981189 --> @sigma67 commented on GitHub (Aug 18, 2021): You're using a playlistId, but you need to use an album browse id. See here: https://github.com/sigma67/ytmusicapi/blob/47214de495fd665389a7c3f110ef6f39c1e76ce7/tests/test.py#L11 https://github.com/sigma67/ytmusicapi/blob/47214de495fd665389a7c3f110ef6f39c1e76ce7/tests/test.py#L125-L127 https://ytmusicapi.readthedocs.io/en/latest/reference.html#ytmusicapi.YTMusic.get_album
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#166
No description provided.