Closed jayceslesar closed 3 years ago
Ah I see, the search_album is not in the official pip install, only in the most up to date. Cheers.
Sorry for commenting on a closed issue, but I was wondering about this too. Not sure if anyone will see this, but I hope no one minds me asking.
What's the suggested method call for searching by album right now? I see that there's an example of searching by album in the docs, but it looks like doing so requires searching by song first, and then sort of backtracking to get the album.
genius = Genius(token)
song = genius.search_song(378195)
album_id = song['album']['id']
album = genius.album(album_id)
print(album['name'])
Is there a better way to grab all of the songs belonging to a specific album?
Will the next build that passes CI include search_album?
Thank you!
@ameryisafreeelf, to get the tracks of an album you'd either have to know the album ID and use genius.album_tracks(album_id)
or search for the album using genius.search_albums(album_name)
to find the album ID and then get the tracks. Alternatively, you could use genius.search_album
which based on the parameters you supply, does what I mentioned above for you, and then gets the lyrics for each track.
Hopefully, the next build will be version 3.0 which will have search_album
but until then you can use the master version (pip install git+https://github.com/johnwmillr/LyricsGenius.git
)
@Allerter
Thanks for the reply! I took a closer look at the Genius API- looks like they don't natively support an endpoint for getting albums. Pretty annoying, but I'm sure they have their reasons for not creating that endpoint. So anyway, it makes sense that doing an album search will require some more heavy lifting on our end (from the wrapper).
The search_album that exists on the README does not exist in the program anymore? I was going to use this to help define stopwords per album to get more accuracy when analyzing artists and their lyrics and now I can't do that?