get_charts: add docs, fix some bugs (#213)
This commit is contained in:
parent
42f08d1766
commit
07794f70cf
6 changed files with 134 additions and 12 deletions
|
|
@ -41,15 +41,15 @@ def parse_chart_artist(data):
|
|||
|
||||
|
||||
def parse_chart_trending(data):
|
||||
views = get_flex_column_item(data, 2)
|
||||
if views:
|
||||
views = views.split(' ')[0]
|
||||
flex_0 = get_flex_column_item(data, 0)
|
||||
artists = parse_song_artists(data, 1)
|
||||
views = artists.pop() # last item is views for some reason
|
||||
views = views['name'].split(' ')[0]
|
||||
return {
|
||||
'title': nav(flex_0, TEXT_RUN_TEXT),
|
||||
'videoId': nav(flex_0, TEXT_RUN + NAVIGATION_VIDEO_ID),
|
||||
'playlistId': nav(flex_0, TEXT_RUN + NAVIGATION_PLAYLIST_ID),
|
||||
'artists': parse_song_artists(data, 1),
|
||||
'artists': artists,
|
||||
'thumbnails': nav(data, THUMBNAILS),
|
||||
'views': views
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue