[GH-ISSUE #627] get_playlist track artists are now None #428

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

Originally created by @ghost on GitHub (Jul 17, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/627

Describe the bug
In version 1.7.5, the value of artists in all tracks items in get_playlist() data is always None. This is not the case in 1.7.4.

To Reproduce

>>> from ytmusicapi import YTMusic
>>> YTMusic().get_playlist('VLPLRktPAG0Z4OaqYZbUGifSu3NpFMFQA3-g')

Additional context

1.7.4:

{
    "owned": False,
    "id": "PLRktPAG0Z4OaqYZbUGifSu3NpFMFQA3-g",
    "privacy": "PUBLIC",
    "description": None,
    "title": "Anime Eurobeat Remixes",
    "artists": [],
    "year": "2024",
    "views": 12,
    "duration": "3 hours, 59 minutes",
    "trackCount": 55,
    "related": [],
    "tracks": [
        {
            "videoId": "JXjuDwBKZ6g",
            "title": "Sono Chi No Sadame / Eurobeat remix",
            "artists": [{"name": "Turbo", "id": "UCus8EVJ7Oc9zINhs-fg8l1Q"}],
            "album": None,
            "likeStatus": "INDIFFERENT",
            "inLibrary": None,
            "thumbnails": [
                {
                    "url": "https://i.ytimg.com/vi/JXjuDwBKZ6g/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kWGK675mblmKOt7De-IOU10qzhxw",
                    "width": 400,
                    "height": 225,
                }
            ],
            "isAvailable": True,
            "isExplicit": False,
            "videoType": "MUSIC_VIDEO_TYPE_UGC",
            "views": None,
            "duration": "3:47",
            "duration_seconds": 227,
        },

1.7.5:

{
    "owned": False,
    "id": "PLRktPAG0Z4OaqYZbUGifSu3NpFMFQA3-g",
    "privacy": "PUBLIC",
    "description": None,
    "title": "Anime Eurobeat Remixes",
    "artists": [],
    "year": "2024",
    "views": 12,
    "duration": "3 hours, 59 minutes",
    "trackCount": 55,
    "related": [],
    "tracks": [
        {
            "videoId": "JXjuDwBKZ6g",
            "title": "Sono Chi No Sadame / Eurobeat remix",
            "artists": None, # <--------------- artists missing
            "album": None,
            "likeStatus": "INDIFFERENT",
            "inLibrary": None,
            "thumbnails": [
                {
                    "url": "https://i.ytimg.com/vi/JXjuDwBKZ6g/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kWGK675mblmKOt7De-IOU10qzhxw",
                    "width": 400,
                    "height": 225,
                }
            ],
            "isAvailable": True,
            "isExplicit": False,
            "videoType": "MUSIC_VIDEO_TYPE_UGC",
            "views": None,
            "duration": "3:47",
            "duration_seconds": 227,
        },

Because of this there is no way to get artist information from a playlist in 1.7.5.

Originally created by @ghost on GitHub (Jul 17, 2024). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/627 **Describe the bug** In version 1.7.5, the value of `artists` in all `tracks` items in `get_playlist()` data is always `None`. This is not the case in 1.7.4. **To Reproduce** ```py >>> from ytmusicapi import YTMusic >>> YTMusic().get_playlist('VLPLRktPAG0Z4OaqYZbUGifSu3NpFMFQA3-g') ``` **Additional context** 1.7.4: ```py { "owned": False, "id": "PLRktPAG0Z4OaqYZbUGifSu3NpFMFQA3-g", "privacy": "PUBLIC", "description": None, "title": "Anime Eurobeat Remixes", "artists": [], "year": "2024", "views": 12, "duration": "3 hours, 59 minutes", "trackCount": 55, "related": [], "tracks": [ { "videoId": "JXjuDwBKZ6g", "title": "Sono Chi No Sadame / Eurobeat remix", "artists": [{"name": "Turbo", "id": "UCus8EVJ7Oc9zINhs-fg8l1Q"}], "album": None, "likeStatus": "INDIFFERENT", "inLibrary": None, "thumbnails": [ { "url": "https://i.ytimg.com/vi/JXjuDwBKZ6g/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kWGK675mblmKOt7De-IOU10qzhxw", "width": 400, "height": 225, } ], "isAvailable": True, "isExplicit": False, "videoType": "MUSIC_VIDEO_TYPE_UGC", "views": None, "duration": "3:47", "duration_seconds": 227, }, ``` 1.7.5: ```py { "owned": False, "id": "PLRktPAG0Z4OaqYZbUGifSu3NpFMFQA3-g", "privacy": "PUBLIC", "description": None, "title": "Anime Eurobeat Remixes", "artists": [], "year": "2024", "views": 12, "duration": "3 hours, 59 minutes", "trackCount": 55, "related": [], "tracks": [ { "videoId": "JXjuDwBKZ6g", "title": "Sono Chi No Sadame / Eurobeat remix", "artists": None, # <--------------- artists missing "album": None, "likeStatus": "INDIFFERENT", "inLibrary": None, "thumbnails": [ { "url": "https://i.ytimg.com/vi/JXjuDwBKZ6g/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kWGK675mblmKOt7De-IOU10qzhxw", "width": 400, "height": 225, } ], "isAvailable": True, "isExplicit": False, "videoType": "MUSIC_VIDEO_TYPE_UGC", "views": None, "duration": "3:47", "duration_seconds": 227, }, ``` Because of this there is no way to get artist information from a playlist in 1.7.5.
kerem closed this issue 2026-02-27 23:00:45 +03:00
Author
Owner

@czifumasa commented on GitHub (Jul 17, 2024):

So yet another case, that I have to adapt to the new logic, this time it's videos uploaded from non-official user channels. I guess initially in 1.7.4 it worked, but then I fixed albums (#618) and I broke this one.

I will revert my fix from #618 and I will remove the new logic for albums, bringing back preset flexColumn meanings.

What do you think? @sigma67

P.S. I know we need tests for all these cases, but tbh I am not sure how to design them.

<!-- gh-comment-id:2233844226 --> @czifumasa commented on GitHub (Jul 17, 2024): So yet another case, that I have to adapt to the new logic, this time it's videos uploaded from non-official user channels. I guess initially in 1.7.4 it worked, but then I fixed albums (#618) and I broke this one. I will revert my fix from #618 and I will remove the new logic for albums, bringing back preset flexColumn meanings. What do you think? @sigma67 P.S. I know we need tests for all these cases, but tbh I am not sure how to design them.
Author
Owner

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

Reverting the fix won't help because then you break the other use cases again.

Good tests would be to add asserts on the existing tests. For all tests with static album and playlist ids (where tracks are known to have artists), add an assert that ensures the artist is parsed correctly

<!-- gh-comment-id:2235677957 --> @sigma67 commented on GitHub (Jul 18, 2024): Reverting the fix won't help because then you break the other use cases again. Good tests would be to add asserts on the existing tests. For all tests with static album and playlist ids (where tracks are known to have artists), add an assert that ensures the artist is parsed correctly
Author
Owner

@czifumasa commented on GitHub (Jul 18, 2024):

What I meant is removing the new logic, but only for albums (see: 3208ca9). So for albums columns are hardcoded and for playlist they are still resolved using navigationEndpoints.

There are border cases with columns without navigationEndpoint, where I have to guess their meaning. Those cases are different for albums and for playlists, so I cannot use the same logic for both methods. Albums always have the same order of flexColumns, so dynamic resolving is not needed there.

<!-- gh-comment-id:2236353896 --> @czifumasa commented on GitHub (Jul 18, 2024): What I meant is removing the new logic, but only for albums (see: [3208ca9](https://github.com/czifumasa/ytmusicapi/commit/3208ca9f9132171872168a4cb9b6e6ac40c1fd82)). So for albums columns are hardcoded and for playlist they are still resolved using `navigationEndpoints`. There are border cases with columns without `navigationEndpoint`, where I have to guess their meaning. Those cases are different for albums and for playlists, so I cannot use the same logic for both methods. Albums always have the same order of `flexColumns`, so dynamic resolving is not needed there.
Author
Owner

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

I see, that's fine. Please also consider the suggestions key in get_playlist in your tests (although I'm not sure why it should behave differently - maybe it doesn't)

<!-- gh-comment-id:2236748087 --> @sigma67 commented on GitHub (Jul 18, 2024): I see, that's fine. Please also consider the `suggestions` key in `get_playlist` in your tests (although I'm not sure why it should behave differently - maybe it doesn't)
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#428
No description provided.