Update get_library_albums parsing to new YT Web display format (closes #84)

Change 'artists' key to dict with name/id
This commit is contained in:
sigma67 2020-09-28 14:45:25 +02:00
commit 5a1032983d
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
2 changed files with 20 additions and 4 deletions

View file

@ -51,9 +51,11 @@ def parse_albums(results, upload=True):
'id': nav(subtitle, NAVIGATION_BROWSE_ID)
})
else:
album['artists'] = nav(data, SUBTITLE)
album['year'] = nav(data, SUBTITLE2)
album['trackCount'] = nav(data, SUBTITLE3).split(' ')[0]
album['artists'] = {
'name': nav(data, SUBTITLE2),
'id': nav(data, ['subtitle', 'runs', 2] + NAVIGATION_BROWSE_ID, True)
}
album['year'] = nav(data, SUBTITLE3)
albums.append(album)