Add get_artist_albums (closes #4)

This commit also circumvents an issue with get_artist, where the API sometimes fails to return songs.
This commit is contained in:
sigma67 2020-04-17 00:42:39 +02:00
commit 4a653c5285
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
5 changed files with 64 additions and 17 deletions

View file

@ -131,11 +131,11 @@ def parse_search_result(data, resultType = None):
return search_result
def get_item_text(item, index):
def get_item_text(item, index, run_index=0):
if 'runs' not in item['flexColumns'][index]['musicResponsiveListItemFlexColumnRenderer']['text']:
return None
return item['flexColumns'][index]['musicResponsiveListItemFlexColumnRenderer']['text']['runs'][0]['text']
return item['flexColumns'][index]['musicResponsiveListItemFlexColumnRenderer']['text']['runs'][run_index]['text']
def prepare_browse_endpoint(type, browseId):