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

Add a get_artist_songs just like get_artist_albums #596

Closed
kevinmarquesp opened this issue May 30, 2024 · 1 comment
Closed

Add a get_artist_songs just like get_artist_albums #596

kevinmarquesp opened this issue May 30, 2024 · 1 comment

Comments

@kevinmarquesp
Copy link

Is your feature request related to a problem? Please describe.
I would be nice to have a get_artist_songs() just like the get_artist_albums(), but without the params because the get_artist() function returns doesn't have a params key in the songs field.

Describe the solution you'd like
For an example of usage that I expect:

from ytmusicapi import YTMusic

ytm = YTMusic()

artist = ytm.get_artist("UCu3D7Xd6Wxt4f1PYokvZVVA")
browse_id = artist["songs"]["browseId"]

songs = ytm.get_artist_songs(browse_id, limit=None)

# Then I expect to get an list of a bunch of song dicts.
print(songs)

Describe alternatives you've considered
I tried to follow the docs, there was said that I could do that with the get_artist_albums() function, but it didn't work because of the params field that the songs doesn't have, unlike the singles, videos and albums. Maybe fixing that issue would be better, but I still prefer a separate function for them all.

Additional context
I was trying to create a CLI application that will allow users to fetch JSON data from the Youtube Music API and integrate it with yt-dlp with jq, or something like that, and the songs subcommand isn't working in anyway.

@sigma67
Copy link
Owner

sigma67 commented May 30, 2024

If you read the docs carefully, you'll find that the songs key contains a browseId, which is usable with get_playlist.

https://ytmusicapi.readthedocs.io/en/latest/reference.html#ytmusicapi.YTMusic.get_artist

@sigma67 sigma67 closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
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