Add fallback for parsing album audioPlaylistId (#219, closes #220)

This commit is contained in:
sigma67 2021-08-18 15:40:01 +02:00
commit 57528ffbdd
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0

View file

@ -25,7 +25,9 @@ def parse_album_header(response):
# add to library/uploaded
menu = nav(header, MENU)
toplevel = menu['topLevelButtons']
album['audioPlaylistId'] = nav(toplevel, [0, 'buttonRenderer'] + NAVIGATION_WATCH_PLAYLIST_ID)
album['audioPlaylistId'] = nav(toplevel, [0, 'buttonRenderer'] + NAVIGATION_WATCH_PLAYLIST_ID, True)
if not album['audioPlaylistId']:
album['audioPlaylistId'] = nav(toplevel, [0, 'buttonRenderer'] + NAVIGATION_PLAYLIST_ID, True)
service = nav(toplevel, [1, 'buttonRenderer', 'defaultServiceEndpoint'], True)
if service:
album['likeStatus'] = parse_like_status(service)