Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_album doesn't fetch audioPlaylistId for some albums #675

Closed
srajangarg opened this issue Nov 7, 2024 · 2 comments · Fixed by #692
Closed

get_album doesn't fetch audioPlaylistId for some albums #675

srajangarg opened this issue Nov 7, 2024 · 2 comments · Fixed by #692
Labels
bug Something isn't working

Comments

@srajangarg
Copy link

srajangarg commented Nov 7, 2024

Describe the bug
get_album doesn't fetch audioPlaylistId for some albums. whether it is authenticated or not, both fail

To Reproduce

from ytmusicapi import YTMusic


ytmusic = YTMusic("oauth.json")
ytmusic2 = YTMusic()

browse_id = "MPREb_6egF9klMJg7"

album_details = ytmusic.get_album(browse_id)
print(album_details['audioPlaylistId'])

album_details = ytmusic2.get_album(browse_id)
print(album_details['audioPlaylistId'])

# verify that a playlist id for this album does exist
expected_playlist_id = "OLAK5uy_k8nXdYeGt9_ES_a_n-UHkL2W3n2coCR_4"
fetched_browse_id = ytmusic.get_album_browse_id(expected_playlist_id)
assert fetched_browse_id == browse_id

prints

None
None

with the assert passing

@ryanopily
Copy link
Contributor

It looks like a problem with the the function parse_album_header_2024(response) in albums.py

This line specifically: album["audioPlaylistId"] = nav( buttons, [1, "musicPlayButtonRenderer", "playNavigationEndpoint", *WATCH_PLAYLIST_ID], True )

The code expects *WATCH_PLAYLIST_ID to be in buttons, but it actually has *WATCH_PID.

@sigma67 sigma67 added the bug Something isn't working label Dec 17, 2024
@sigma67
Copy link
Owner

sigma67 commented Dec 17, 2024

This always happens when the button order changes. Will need to use a different approach to find the correct one.

sigma67 added a commit that referenced this issue Dec 17, 2024
@sigma67 sigma67 mentioned this issue Dec 17, 2024
sigma67 added a commit that referenced this issue Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants