sigma67 / ytmusicapi

Unofficial API for YouTube Music
https://ytmusicapi.readthedocs.io
MIT License
1.59k stars 184 forks source link

get_library_songs() returns 'album': None for all songs #548

Closed fischcode closed 4 months ago

fischcode commented 4 months ago

Changes in ytmusicapi 1.5.2 have broken the parsing of albums in get_library_songs(): Instead of the actual album, 'album': None is returned for all songs. This problem is not present in ytmusicapi 1.5.1 but mainfest in ytmusicapi 1.5.2 and ytmusicapi main as of 2024-02-18

fischcode commented 4 months ago

Meanwhile, I was able to track down the issue to parse_playlist_items() in parsers/playlists.py: With my tests (using an account with region set to Switzerland), album information is retrieved using parse_song_album(data, 2) [as in ytmusicapi 1.5.1] instead of parse_song_album(data, 3) [as in ytmusicapi 1.5.2] So far, I haven't been able to modify my regional settings and get any other behavior.

sigma67 commented 4 months ago

This is the responsible commit: https://github.com/sigma67/ytmusicapi/commit/b2113db0e15cbc9bec2e1c308bf4c144fb48a937

Maybe we need to add a flag to determine the index based on the keys present. The views column was added, which caused a shift of the albums to the right

fischcode commented 4 months ago

I would be happy to propose a solution but would need a sample JSON containing the views column for testing: I tried in YT Music with different region and language settings but didn't manage to get to see one up to now: grafik Do you know of any settings other than region and language that might control whether a views colums is rendered or not? Or can you send me a sample JSON containing the views column which I could use to test against?

fischcode commented 4 months ago

Eventually, I found a 'plays' count when listing the contents of an album (which appears to be parsed using the same parse_playlist_itms() function: grafik If you can confirm that you experience the same behavior, I would go ahead and propose a modification parsing column contents based on the is_album parameter.

sigma67 commented 4 months ago

I have never seen views in the library, only on playlists and albums.

fischcode commented 4 months ago

OK, then I know what I have to do -> PR will follow. A question out of context: What made you conclude that the 'Trending' category no longer exists in Charts? I see it for every country I checked today, except 'Global': grafik

sigma67 commented 4 months ago

Yeah.. seems that was part of the same A/B test I was caught in. I reverted it also in the linked PR. Can you test with that if everything works ok?

pip install git+https://github.com/sigma67/ytmusicapi@fix-548