fix #743: get_album() now returns None for 'audioPlaylistId' (#744)

* fix #743: get_album() now returns None for 'audioPlaylistId'

* backwards compatibility
This commit is contained in:
sigma67 2025-03-05 21:48:06 +01:00 • committed by GitHub
commit 5e3bc62620
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,9 +64,16 @@ def parse_album_header_2024(response):
buttons = header["buttons"]
album["audioPlaylistId"] = nav(
find_object_by_key(buttons, "musicPlayButtonRenderer"),
["musicPlayButtonRenderer", "playNavigationEndpoint", *WATCH_PLAYLIST_ID],
["musicPlayButtonRenderer", "playNavigationEndpoint", *WATCH_PID],
True,
)
# remove this once A/B testing is finished and it is no longer covered
if album["audioPlaylistId"] is None:
album["audioPlaylistId"] = nav(
find_object_by_key(buttons, "musicPlayButtonRenderer"),
["musicPlayButtonRenderer", "playNavigationEndpoint", *WATCH_PLAYLIST_ID],
True,
)
service = nav(
find_object_by_key(buttons, "toggleButtonRenderer"),
["toggleButtonRenderer", "defaultServiceEndpoint"],