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

album information on playlist tracks getting wrongly assigned on collaborative playlists #603

Open
elgerre opened this issue Jun 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@elgerre
Copy link

elgerre commented Jun 17, 2024

Describe the bug
if a playlist has multiple users adding tracks to it, then the user who added a track to the playlist is returned in the "album" field.
The correct album information of the track can then be found in the "views" field instead.

To Reproduce
Steps to reproduce the behavior:

  1. have a playlist with multiple users working on it
  2. use the get_playlist() function to get the tracks of this playlist

Additional context
see below two examples of unlisted playlists, one working fine, the other one having the described issue.

from ytmusicapi import YTMusic
ytmusic = YTMusic()

# working correctly for single user playlist
playlist_correct=ytmusic.get_playlist(playlistId="PLLUwvN74i5M6B17EPqCTZqzq0lUy-aMFe",limit=1)
print(playlist_correct)

# not working correctly with multiple users
playlist_incorrect=ytmusic.get_playlist(playlistId="PLLUwvN74i5M7uuzGi6vRaUehPY4njg036",limit=1)
print(playlist_incorrect)

I was using ytmusicapi to import an entire playlist, that a friend and I were working on, into pandas dataframes to do some analytics just for fun and noticed the album names being just our usernames.
After further inspection I found the correct album name under "views" which confused me a little bit.
Then after trying out the code with another playlist(one without any collaboration) I realized, that it worked fine in that case, so I guess its the additional field that YT Music puts there.
This extra field also shows up in the browser once you invite other users to edit your playlist.

@sigma67
Copy link
Owner

sigma67 commented Jun 18, 2024

Hi, this function is currently not tested in the context of collaborative playlists afaik.

Contribution welcome.

@sigma67 sigma67 added the bug Something isn't working label Jun 18, 2024
@czifumasa
Copy link
Contributor

For collaborative playlists, flexColumns in musicResponsiveListItemRenderer have different order:
0 - title
1 - contributing user
2 - artists
3 - album

For regular playlists it's:
0 - title
1 - artists
2 - album

For albums it's
0 - title
1 - artists if they are different than album artists, otherwise it's empty
2 - views

So index of flexColumns shouldn't be hardcoded as it currently is.

Maybe we could use navigationEndpoint to find the meaning of the column. There is pageType: 'MUSIC_PAGE_TYPE_ARTIST' if column contains artist and pageType: 'MUSIC_PAGE_TYPE_USER_CHANNEL' if column contains contributing user.

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

No branches or pull requests

3 participants