Fix get_artist when views are missing (closes #33)
This commit is contained in:
parent
51100b7e24
commit
7d7dc72567
1 changed files with 2 additions and 1 deletions
|
|
@ -273,7 +273,8 @@ class YTMusic:
|
||||||
is_key=True)
|
is_key=True)
|
||||||
if descriptionShelf:
|
if descriptionShelf:
|
||||||
artist['description'] = descriptionShelf['description']['runs'][0]['text']
|
artist['description'] = descriptionShelf['description']['runs'][0]['text']
|
||||||
artist['views'] = to_int(descriptionShelf['subheader']['runs'][0]['text'])
|
artist['views'] = None if 'subheader' not in descriptionShelf else descriptionShelf[
|
||||||
|
'subheader']['runs'][0]['text']
|
||||||
subscription_button = header['subscriptionButton']['subscribeButtonRenderer']
|
subscription_button = header['subscriptionButton']['subscribeButtonRenderer']
|
||||||
artist['channelId'] = subscription_button['channelId']
|
artist['channelId'] = subscription_button['channelId']
|
||||||
artist['subscribers'] = nav(subscription_button,
|
artist['subscribers'] = nav(subscription_button,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue