Added lyrics source & fixed method for songs which do not have lyrics
This commit is contained in:
parent
d62e3f8079
commit
a1fee33e37
1 changed files with 6 additions and 1 deletions
|
|
@ -664,6 +664,11 @@ class BrowsingMixin:
|
|||
body['browseId'] = tab['tabRenderer']['endpoint']['browseEndpoint']['browseId']
|
||||
if body['browseId'] != None:
|
||||
response = self._send_request('browse', body)
|
||||
body['lyrics'] = (response['contents']['sectionListRenderer']['contents'][0]['musicDescriptionShelfRenderer']['description']['runs'][0]['text'])
|
||||
if 'sectionListRenderer' in response['contents'].keys():
|
||||
body['lyrics'] = response['contents']['sectionListRenderer']['contents'][0]['musicDescriptionShelfRenderer']['description']['runs'][0]['text']
|
||||
body['source'] = response['contents']['sectionListRenderer']['contents'][0]['musicDescriptionShelfRenderer']['footer']['runs'][0]['text']
|
||||
else:
|
||||
body['lyrics'] = response['contents']['messageRenderer']['subtext']['messageSubtextRenderer']['text']['runs'][0]['text']
|
||||
body['source'] = response['contents']['messageRenderer']['text']['runs'][0]['text']
|
||||
body.pop('context', None)
|
||||
return body
|
||||
|
|
|
|||
Loading…
Reference in a new issue