[GH-ISSUE #489] get_artist_albums method producing KeyError: 'musicCarouselShelfRenderer' #364

Closed
opened 2026-02-27 23:00:24 +03:00 by kerem · 2 comments
Owner

Originally created by @Utkarsh-vishnoi on GitHub (Dec 17, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/489

On executing get_artist_albums, It gives me KeyError: 'musicCarouselShelfRenderer'. I have double checked and make sure, I am using the latest version i.e. version 1.3.2. I have provided the code to reproduce the error below.

To Reproduce
Run the below piece of code

#!/usr/bin/env python3

from ytmusicapi import YTMusic

if __name__ == '__main__':
    ytmusic = YTMusic("oauth.json")
    artistParam = ytmusic.get_artist(channelId='UCedvOgsKFzcK3hA5taf3KoQ')['albums']['params'] // Channel: Eminem
    result = ytmusic.get_artist_albums(channelId='UCedvOgsKFzcK3hA5taf3KoQ', params=artistParam)
    print(result)

Additional context
I have used oauth for authentication
I get the following error upon executing the code.

Traceback (most recent call last):
  File "/workspaces/muse/DB/test.py", line 8, in <module>
    result = ytmusic.get_artist_albums(channelId='UCedvOgsKFzcK3hA5taf3KoQ', params=artistParam)
  File "/usr/local/python/3.10.8/lib/python3.10/site-packages/ytmusicapi/mixins/browsing.py", line 256, in get_artist_albums
    results = nav(results, GRID_ITEMS, True) or nav(results, CAROUSEL_CONTENTS)
  File "/usr/local/python/3.10.8/lib/python3.10/site-packages/ytmusicapi/navigation.py", line 82, in nav
    raise err
  File "/usr/local/python/3.10.8/lib/python3.10/site-packages/ytmusicapi/navigation.py", line 76, in nav
    root = root[k]
KeyError: 'musicCarouselShelfRenderer'
Originally created by @Utkarsh-vishnoi on GitHub (Dec 17, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/489 On executing `get_artist_albums`, It gives me `KeyError: 'musicCarouselShelfRenderer'`. I have double checked and make sure, I am using the latest version i.e. version 1.3.2. I have provided the code to reproduce the error below. **To Reproduce** Run the below piece of code ``` #!/usr/bin/env python3 from ytmusicapi import YTMusic if __name__ == '__main__': ytmusic = YTMusic("oauth.json") artistParam = ytmusic.get_artist(channelId='UCedvOgsKFzcK3hA5taf3KoQ')['albums']['params'] // Channel: Eminem result = ytmusic.get_artist_albums(channelId='UCedvOgsKFzcK3hA5taf3KoQ', params=artistParam) print(result) ``` **Additional context** I have used oauth for authentication I get the following error upon executing the code. ``` Traceback (most recent call last): File "/workspaces/muse/DB/test.py", line 8, in <module> result = ytmusic.get_artist_albums(channelId='UCedvOgsKFzcK3hA5taf3KoQ', params=artistParam) File "/usr/local/python/3.10.8/lib/python3.10/site-packages/ytmusicapi/mixins/browsing.py", line 256, in get_artist_albums results = nav(results, GRID_ITEMS, True) or nav(results, CAROUSEL_CONTENTS) File "/usr/local/python/3.10.8/lib/python3.10/site-packages/ytmusicapi/navigation.py", line 82, in nav raise err File "/usr/local/python/3.10.8/lib/python3.10/site-packages/ytmusicapi/navigation.py", line 76, in nav root = root[k] KeyError: 'musicCarouselShelfRenderer' ```
kerem 2026-02-27 23:00:24 +03:00
Author
Owner

@Utkarsh-vishnoi commented on GitHub (Dec 26, 2023):

Hi,
Anymore information needed from my end?

Thanks & Regards,
Utkarsh Vishnoi

<!-- gh-comment-id:1869766014 --> @Utkarsh-vishnoi commented on GitHub (Dec 26, 2023): Hi, Anymore information needed from my end? Thanks & Regards, Utkarsh Vishnoi
Author
Owner

@sigma67 commented on GitHub (Dec 27, 2023):

from ytmusicapi import YTMusic
ytmusic = YTMusic()
artistParam = ytmusic.get_artist(channelId='UCedvOgsKFzcK3hA5taf3KoQ')
result = ytmusic.get_artist_albums(channelId=artistParam['albums']['browseId'], params=artistParam['albums']['params'])
<!-- gh-comment-id:1870633501 --> @sigma67 commented on GitHub (Dec 27, 2023): ```python from ytmusicapi import YTMusic ytmusic = YTMusic() artistParam = ytmusic.get_artist(channelId='UCedvOgsKFzcK3hA5taf3KoQ') result = ytmusic.get_artist_albums(channelId=artistParam['albums']['browseId'], params=artistParam['albums']['params']) ```
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#364
No description provided.