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

Throw custom error if song has no lyrics #227

Open
Rsalganik1123 opened this issue Oct 26, 2021 · 1 comment
Open

Throw custom error if song has no lyrics #227

Rsalganik1123 opened this issue Oct 26, 2021 · 1 comment

Comments

@Rsalganik1123
Copy link

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 :)

@jmmelko
Copy link

jmmelko commented Dec 27, 2021

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

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