add get_charts (#213)

This commit is contained in:
sigma67 2021-07-11 18:39:40 +02:00
commit 42f08d1766
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
10 changed files with 240 additions and 102 deletions

View file

@ -5,7 +5,7 @@ from .utils import *
def parse_artists(results, uploaded=False):
artists = []
for result in results:
data = result['musicResponsiveListItemRenderer']
data = result[MRLIR]
artist = {}
artist['browseId'] = nav(data, NAVIGATION_BROWSE_ID)
artist['artist'] = get_item_text(data, 0)
@ -43,7 +43,7 @@ def parse_library_albums(response, request_func, limit):
def parse_albums(results):
albums = []
for result in results:
data = result['musicTwoRowItemRenderer']
data = result[MTRIR]
album = {}
album['browseId'] = nav(data, TITLE + NAVIGATION_BROWSE_ID)
album['title'] = nav(data, TITLE_TEXT)