johnwmillr / LyricsGenius

Download song lyrics and metadata from Genius.com 🎶🎤
http://www.johnwmillr.com/scraping-genius-lyrics/
MIT License
898 stars 159 forks source link

Option to Include Songs the Artist Features On #119

Closed danielcliu closed 4 years ago

danielcliu commented 4 years ago

Desired Feature I think it would be nice to have an option to include an artist's featured work to be returned in the get_artist_songs() call. This would allow someone to really get the entirety of a specific artist's work. For example, right now if you genius.search_artist('Kendrick Lamar', max_songs=5) you will get

Song 1: "HUMBLE."
Song 2: "​m.A.A.d city"
Song 3: "Swimming Pools (Drank)"
Song 4: "DNA."
Song 5: "XXX.

but it would be nice to have the option to get songs he features on as well, so that the top 5 would look like

Song 1: "HUMBLE."
Song 2: "F****n’ Problems"
Song 3: "​m.A.A.d city"
Song 4: "Swimming Pools (Drank)"
Song 5: "DNA."

Proposed Solution Include an optional boolean in the search_artist() call to allow for features to be allowed to be returned in the results. ie genius.search_artist('Kendrick Lamar', include_features=True)

Alternatives Considered I don't have any realistic ones outside of just saying that an artist object can't contain songs where they aren't the main artist, and mandating that features must be found by searching for the original artist or the song by name.

Additional context I am willing to work on this issue, if that is ok

johnwmillr commented 4 years ago

Hi @danielcliu, I like the idea of an include_features tag, but does the Genius.com search interface provide this sort of functionality? I suppose we could just take all songs returned when searching for "Kendrick Lamar" even if the song's author != Kendrick, but the title contains "featuring" or "feat.", etc.

Do you want to put a proof of concept together?

danielcliu commented 4 years ago

The Genius.com search interface seems to provide this functionality off the bat, most easily seen if you go to an artist's page and then click on the "Show all songs by ", then sort by page views. It should include songs where the artist features. The functionality is also replicable in the Genius API as well as far as I can tell, as seen when you go to the API example page and GET /artists/:id/songs input with id = 1421 (Kendrick's ID) and sort = popularity. Then in the second response Kendrick Lamar should not be the primary artist.

allerter commented 4 years ago

Added in #124