[GH-ISSUE #859] YTMusic.get_artist fails with KeyError on some accounts #523

Closed
opened 2026-02-27 23:01:16 +03:00 by kerem · 3 comments
Owner

Originally created by @mayty on GitHub (Jan 27, 2026).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/859

  • I confirm that I have read the FAQ

Describe the bug

YTMusic.get_artist fails with KeyError on some account.

ytmusicapi version

1.11.4

To Reproduce

from ytmusicapi import YTMusic

YTMusic().get_artist('UCfXUOEgx-767Ra2rr9zIVzQ')

Results in:

Traceback (most recent call last):
  ...
  File "/app/.venv/lib/python3.14/site-packages/ytmusicapi/mixins/browsing.py", line 255, in get_artist
    header = response["header"]["musicImmersiveHeaderRenderer"]
             ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'musicImmersiveHeaderRenderer'

Additional context
Some more channel ids, which generate the same error:

UCGuKdstTnJ07JpfUKM5UItA
UC7GXlGOw7kaQ7b1RkcXhW9A
UCGSmbef0RQQVk4C8xmXsygg
UCv9g0GR9Vb1ClzHaI28tiUg
UCJUVohHF3t7kuCgBz9PkqCw
UCGdfTyDg_g0yTethTEu2pkA
UCmga7AegiORoj6i2073HZLg
Originally created by @mayty on GitHub (Jan 27, 2026). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/859 - [x] I confirm that I have read the [FAQ](https://ytmusicapi.readthedocs.io/en/stable/faq.html#why-is-ytmusicapi-returning-more-results-than-requested-with-the-limit-parameter) **Describe the bug** `YTMusic.get_artist` fails with `KeyError` on some account. **ytmusicapi version** 1.11.4 **To Reproduce** ```py from ytmusicapi import YTMusic YTMusic().get_artist('UCfXUOEgx-767Ra2rr9zIVzQ') ``` Results in: ``` Traceback (most recent call last): ... File "/app/.venv/lib/python3.14/site-packages/ytmusicapi/mixins/browsing.py", line 255, in get_artist header = response["header"]["musicImmersiveHeaderRenderer"] ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'musicImmersiveHeaderRenderer' ``` **Additional context** Some more channel ids, which generate the same error: ``` UCGuKdstTnJ07JpfUKM5UItA UC7GXlGOw7kaQ7b1RkcXhW9A UCGSmbef0RQQVk4C8xmXsygg UCv9g0GR9Vb1ClzHaI28tiUg UCJUVohHF3t7kuCgBz9PkqCw UCGdfTyDg_g0yTethTEu2pkA UCmga7AegiORoj6i2073HZLg ```
kerem 2026-02-27 23:01:16 +03:00
  • closed this issue
  • added the
    a/b
    label
Author
Owner

@sigma67 commented on GitHub (Jan 28, 2026):

Can you spot visual differences on the artist pages? Screenshots of successful account vs. unsuccessful would help

<!-- gh-comment-id:3810137919 --> @sigma67 commented on GitHub (Jan 28, 2026): Can you spot visual differences on the artist pages? Screenshots of successful account vs. unsuccessful would help
Author
Owner

@sgvictorino commented on GitHub (Jan 28, 2026):

These aren't artist channels, so get_channel works.

<!-- gh-comment-id:3812832313 --> @sgvictorino commented on GitHub (Jan 28, 2026): These aren't artist channels, so `get_channel` works.
Author
Owner

@mayty commented on GitHub (Jan 28, 2026):

@sigma67
After double-checking, these ids lead to channels that match the style of a channel given in the documentation of the YTMusic.get_user() method. So I'll be closing this issue, as it's a user error

<!-- gh-comment-id:3814008621 --> @mayty commented on GitHub (Jan 28, 2026): @sigma67 After double-checking, these ids lead to channels that match the style of a channel given in the documentation of the `YTMusic.get_user()` method. So I'll be closing this issue, as it's a user error
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#523
No description provided.