Skip to content

Commit

Permalink
fix #743: get_album() now returns None for 'audioPlaylistId' (#744)
Browse files Browse the repository at this point in the history
* fix #743: get_album() now returns None for 'audioPlaylistId'

* backwards compatibility
  • Loading branch information
sigma67 authored Mar 5, 2025
1 parent c60950a commit 5e3bc62
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ytmusicapi/parsers/albums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 5e3bc62

Please sign in to comment.