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_playlist track artists are now None #627

Closed
ghost opened this issue Jul 17, 2024 · 4 comments
Closed

get_playlist track artists are now None #627

ghost opened this issue Jul 17, 2024 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 17, 2024

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.

czifumasa added a commit to czifumasa/ytmusicapi that referenced this issue Jul 17, 2024
@czifumasa
Copy link
Collaborator

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.

@sigma67
Copy link
Owner

sigma67 commented 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

@czifumasa
Copy link
Collaborator

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.

@sigma67
Copy link
Owner

sigma67 commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants