[GH-ISSUE #346] KeyError: 'gridRenderer' #271

Closed
opened 2026-02-27 22:08:55 +03:00 by kerem · 3 comments
Owner

Originally created by @dsm-72 on GitHub (Jan 30, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/346

artist = ytmusic.get_artist(channelId=YOUTUBE_MUSIC_ARTIST_ID)

Any idea what causes this?

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In [71], line 1
----> 1 artist_albums = ytmusic.get_artist_albums(YOUTUBE_MUSIC_ARTIST_ID, artist['albums']['browseId'])

File ~/anaconda3/envs/discography/lib/python3.10/site-packages/ytmusicapi/mixins/browsing.py:253, in BrowsingMixin.get_artist_albums(self, channelId, params)
    251 endpoint = 'browse'
    252 response = self._send_request(endpoint, body)
--> 253 results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + GRID_ITEMS)
    254 albums = parse_albums(results)
    256 return albums

File ~/anaconda3/envs/discography/lib/python3.10/site-packages/ytmusicapi/navigation.py:78, in nav(root, items, none_if_absent)
     76     return None
     77 else:
---> 78     raise err

File ~/anaconda3/envs/discography/lib/python3.10/site-packages/ytmusicapi/navigation.py:72, in nav(root, items, none_if_absent)
     70 try:
     71     for k in items:
---> 72         root = root[k]
     73     return root
     74 except Exception as err:

KeyError: 'gridRenderer'
Originally created by @dsm-72 on GitHub (Jan 30, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/346 ```python artist = ytmusic.get_artist(channelId=YOUTUBE_MUSIC_ARTIST_ID) ``` Any idea what causes this? ```bash --------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In [71], line 1 ----> 1 artist_albums = ytmusic.get_artist_albums(YOUTUBE_MUSIC_ARTIST_ID, artist['albums']['browseId']) File ~/anaconda3/envs/discography/lib/python3.10/site-packages/ytmusicapi/mixins/browsing.py:253, in BrowsingMixin.get_artist_albums(self, channelId, params) 251 endpoint = 'browse' 252 response = self._send_request(endpoint, body) --> 253 results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + GRID_ITEMS) 254 albums = parse_albums(results) 256 return albums File ~/anaconda3/envs/discography/lib/python3.10/site-packages/ytmusicapi/navigation.py:78, in nav(root, items, none_if_absent) 76 return None 77 else: ---> 78 raise err File ~/anaconda3/envs/discography/lib/python3.10/site-packages/ytmusicapi/navigation.py:72, in nav(root, items, none_if_absent) 70 try: 71 for k in items: ---> 72 root = root[k] 73 return root 74 except Exception as err: KeyError: 'gridRenderer' ```
kerem closed this issue 2026-02-27 22:08:56 +03:00
Author
Owner

@sigma67 commented on GitHub (Jan 31, 2023):

Please provide the value you used for YOUTUBE_MUSIC_ARTIST_ID

<!-- gh-comment-id:1409944152 --> @sigma67 commented on GitHub (Jan 31, 2023): Please provide the value you used for YOUTUBE_MUSIC_ARTIST_ID
Author
Owner

@dsm-72 commented on GitHub (Jan 31, 2023):

I think it was on UC4G-AJa7kn8oumI6TT2WXYw during the loop @sigma67

<!-- gh-comment-id:1410370504 --> @dsm-72 commented on GitHub (Jan 31, 2023): I think it was on `UC4G-AJa7kn8oumI6TT2WXYw` during the loop @sigma67
Author
Owner

@sigma67 commented on GitHub (Feb 14, 2023):

That id works fine for me.

<!-- gh-comment-id:1430478727 --> @sigma67 commented on GitHub (Feb 14, 2023): That id works fine for me.
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#271
No description provided.