mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #216] Cannot get album, where is my mistake #166
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#166
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 @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?
@sigma67 commented on GitHub (Aug 18, 2021):
You're using a playlistId, but you need to use an album browse id. See here:
github.com/sigma67/ytmusicapi@47214de495/tests/test.py (L11)github.com/sigma67/ytmusicapi@47214de495/tests/test.py (L125-L127)https://ytmusicapi.readthedocs.io/en/latest/reference.html#ytmusicapi.YTMusic.get_album