[GH-ISSUE #603] album information on playlist tracks getting wrongly assigned on collaborative playlists #412

Closed
opened 2026-02-27 23:00:39 +03:00 by kerem · 4 comments
Owner

Originally created by @elgerre on GitHub (Jun 17, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/603

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.

Originally created by @elgerre on GitHub (Jun 17, 2024). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/603 **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.
kerem 2026-02-27 23:00:39 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@sigma67 commented on GitHub (Jun 18, 2024):

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

Contribution welcome.

<!-- gh-comment-id:2175394552 --> @sigma67 commented on GitHub (Jun 18, 2024): Hi, this function is currently not tested in the context of collaborative playlists afaik. Contribution welcome.
Author
Owner

@czifumasa commented on GitHub (Jun 28, 2024):

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.

<!-- gh-comment-id:2197732881 --> @czifumasa commented on GitHub (Jun 28, 2024): 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.
Author
Owner

@codeblech commented on GitHub (Jun 30, 2024):

I tried to reproduce the bug with my own non-collaborative and collaborative playlists. I had similar issues. Non-collaborative playlist worked fine.
But, for the collaborative playlist, the name of the person who added a song is returned in the "artists" field (Yash Malik is my username). "album" field seems to be correct. "views" field shows the name of the channel on which song is uploaded on.

here's a partial response by get_playlsist() for a collaborative playlist:

{
...
"tracks":
    [
        ...
        {
            "videoId": "f903wQHlE3w",
            "title": "Infinity Repeating (2013 Demo)",
            "artists":
            [
                {
                    "name": "Yash Malik",
                    "id": "xxxxxxxxxxxx-xxxxxxxxx"
                }
            ],
            "album":
            {
                "name": "Random Access Memories (10th Anniversary Edition)",
                "id": "MPREb_eMBjPmWySjR"
            },
            "likeStatus": "INDIFFERENT",
            "inLibrary": null,
            "thumbnails":
            [
                {
                    "url": "https://lh3.googleusercontent.com/R5gMfIj_BHfnfJv_X24gjqUskPT9gwonal56ydS9bIkxsHxaaebzNwHjbIruM54pvcMwcI9PpTJpYPAJ=w60-h60-l90-rj",
                    "width": 60,
                    "height": 60
                },
                {
                    "url": "https://lh3.googleusercontent.com/R5gMfIj_BHfnfJv_X24gjqUskPT9gwonal56ydS9bIkxsHxaaebzNwHjbIruM54pvcMwcI9PpTJpYPAJ=w120-h120-l90-rj",
                    "width": 120,
                    "height": 120
                }
            ],
            "isAvailable": true,
            "isExplicit": false,
            "videoType": "MUSIC_VIDEO_TYPE_ATV",
            "views": "Daft Punk",
            "duration": "4:00",
            "duration_seconds": 240
        },
        ...
...
}  
<!-- gh-comment-id:2198499322 --> @codeblech commented on GitHub (Jun 30, 2024): I tried to reproduce the bug with my own non-collaborative and collaborative playlists. I had similar issues. Non-collaborative playlist worked fine. But, for the collaborative playlist, the name of the person who added a song is returned in the "`artists`" field (_Yash Malik is my username_). "`album`" field seems to be correct. "`views`" field shows the name of the channel on which song is uploaded on. here's a partial response by `get_playlsist()` for a collaborative playlist: ``` { ... "tracks": [ ... { "videoId": "f903wQHlE3w", "title": "Infinity Repeating (2013 Demo)", "artists": [ { "name": "Yash Malik", "id": "xxxxxxxxxxxx-xxxxxxxxx" } ], "album": { "name": "Random Access Memories (10th Anniversary Edition)", "id": "MPREb_eMBjPmWySjR" }, "likeStatus": "INDIFFERENT", "inLibrary": null, "thumbnails": [ { "url": "https://lh3.googleusercontent.com/R5gMfIj_BHfnfJv_X24gjqUskPT9gwonal56ydS9bIkxsHxaaebzNwHjbIruM54pvcMwcI9PpTJpYPAJ=w60-h60-l90-rj", "width": 60, "height": 60 }, { "url": "https://lh3.googleusercontent.com/R5gMfIj_BHfnfJv_X24gjqUskPT9gwonal56ydS9bIkxsHxaaebzNwHjbIruM54pvcMwcI9PpTJpYPAJ=w120-h120-l90-rj", "width": 120, "height": 120 } ], "isAvailable": true, "isExplicit": false, "videoType": "MUSIC_VIDEO_TYPE_ATV", "views": "Daft Punk", "duration": "4:00", "duration_seconds": 240 }, ... ... } ```
Author
Owner

@sigma67 commented on GitHub (Jul 3, 2024):

fixed by #612

thanks @czifumasa !

<!-- gh-comment-id:2207192872 --> @sigma67 commented on GitHub (Jul 3, 2024): fixed by #612 thanks @czifumasa !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#412
No description provided.