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_library_songs() returns 'album': None for all songs #548

Closed
fischcode opened this issue Feb 18, 2024 · 7 comments · Fixed by #550
Closed

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

fischcode opened this issue Feb 18, 2024 · 7 comments · Fixed by #550
Labels
bug Something isn't working

Comments

@fischcode
Copy link
Contributor

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

@sigma67 sigma67 added the bug Something isn't working label Feb 19, 2024
@fischcode
Copy link
Contributor Author

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
Copy link
Owner

sigma67 commented Feb 19, 2024

This is the responsible commit: b2113db

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Owner

sigma67 commented Feb 21, 2024

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

@fischcode
Copy link
Contributor Author

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
Copy link
Owner

sigma67 commented Feb 22, 2024

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

@sigma67 sigma67 linked a pull request Feb 22, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants