Skip to content

Commit

Permalink
get_artist: fix error for artists where some related artists do not h…
Browse files Browse the repository at this point in the history
…ave subscriber numbers (closes #189)
  • Loading branch information
sigma67 committed Apr 14, 2021
1 parent 14b6871 commit 5a337ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ytmusicapi/parsers/browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,12 @@ def parse_playlist(data):


def parse_related_artist(data):
subscribers = nav(data, SUBTITLE, True)
if subscribers:
subscribers = subscribers.split(' ')[0]
return {
'title': nav(data, TITLE_TEXT),
'browseId': nav(data, TITLE + NAVIGATION_BROWSE_ID),
'subscribers': nav(data, SUBTITLE).split(' ')[0],
'subscribers': subscribers,
'thumbnails': nav(data, THUMBNAIL_RENDERER),
}

0 comments on commit 5a337ae

Please sign in to comment.