[GH-ISSUE #33] subheader -> runs may not be present #25

Closed
opened 2026-02-27 22:07:37 +03:00 by kerem · 0 comments
Owner

Originally created by @jdwoody on GitHub (Jun 27, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/33

When searching for an artist, an exception is thrown if the subheader key is missing in the descriptionShelf.
Artist example:

# Roy Hargrove
ytm.get_artist("UC0twFFwo7-ZajQ7SxgcY6bQ")

Simple fix here
... to_int(descriptionShelf.get('subheader', {'runs': [{'text': '0'}]})['runs'][0]['text'])

Originally created by @jdwoody on GitHub (Jun 27, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/33 When searching for an artist, an exception is thrown if the subheader key is missing in the descriptionShelf. Artist example: ```python # Roy Hargrove ytm.get_artist("UC0twFFwo7-ZajQ7SxgcY6bQ") ``` Simple fix [here](https://github.com/sigma67/ytmusicapi/blob/master/ytmusicapi/ytmusic.py#L272) ```... to_int(descriptionShelf.get('subheader', {'runs': [{'text': '0'}]})['runs'][0]['text'])```
kerem closed this issue 2026-02-27 22:07:37 +03:00
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#25
No description provided.