LyricsGenius icon indicating copy to clipboard operation
LyricsGenius copied to clipboard

Throw custom error if song has no lyrics

Open Rsalganik1123 opened this issue 2 years ago β€’ 1 comments

Is your feature request related to a problem? Please describe. Given your current code version, I am unable to differentiate between songs that are in the Genius database but don't have lyrics (like classical music, etc) and songs that aren't in the database. This makes large-scale scraping with different types of music difficult.

Describe the solution you'd like Instead of just outputting an error message, I would like you to throw a custom error (which I can catch) when a song is in the db but not lyrical.

Describe alternatives you've considered Alternatively, I will have to find auxiliary dataset which includes genre and extrapolate whether the song isn't in DB of if the style of it is not lyrical. This is incredibly time consuming and not very accurate (given that even instrumental pieces have vocalizations even if they don't have explicit lyrics).

Additional context I'm sure I'm not the only one doing ML based music projects using your API. I love it, but sadly for this specific case, it's not performing the way I'd like. And if I feel this way, I'm sure other people will too.

Cheers! Thanks for your wonderful work :)

Rsalganik1123 avatar Oct 26 '21 19:10 Rsalganik1123

Actually all you have to do is to set the skip_non_songs option to False

If the Song is not found, the result returned by the API will be None If the Song is found but is instrumental, the API will return a Song object with an empty string for the lyrics

jmmelko avatar Dec 27 '21 01:12 jmmelko