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

lyrics: Detect when you get blocked by Musixmatch #2632

Closed
anarcat opened this issue Jul 17, 2017 · 4 comments · Fixed by #2634
Closed

lyrics: Detect when you get blocked by Musixmatch #2632

anarcat opened this issue Jul 17, 2017 · 4 comments · Fixed by #2634
Labels
feature features we would like to implement

Comments

@anarcat
Copy link
Contributor

anarcat commented Jul 17, 2017

Problem

My IP seems to have been blocked by musixmatch. Some of the lyrics downloaded say:

We are human after all

Human After All
DAFT PUNK

We detected that your IP is blocked.
It looks like you’re a bot or more likely your network may have been blacklisted for some reason.
Please confirm you are a human by checking the box below.

It seems the problem is resolved now because I can't reproduce with a regular web browser. It would be nice, however, to detect such scenarios and not record the problematic lyrics. I am not sure how to do this - I don't know if a different status code gets sent, but maybe we can do a simple regex-based pattern-matching technique?

Thanks!

@anarcat
Copy link
Contributor Author

anarcat commented Jul 17, 2017

workaround: to reset the state of the database and clear those bad entries, use the following command:

sqlite3 ~/.config/beets/library.db "UPDATE items SET lyrics = '' WHERE lyrics LIKE '%We detected that your IP is blocked%';"

seems to me we should have a way to do throttling or something to workaround that block. FWIW, i was able to download about 20k titles before getting blocked.

@sampsyo sampsyo added the feature features we would like to implement label Jul 17, 2017
@sampsyo sampsyo changed the title detect when you get blocked by musixmatch lyrics: Detect when you get blocked by Musixmatch Jul 17, 2017
@sampsyo
Copy link
Member

sampsyo commented Jul 17, 2017

Sure; sounds good. Just checking whether the string "We detected that your IP is blocked." is in the response should do it. Until someone writes a hit song about rate limiting… 😃

@anarcat
Copy link
Contributor Author

anarcat commented Jul 17, 2017

hehe... i also figured out this is just a CAPTCHA page you can fill in to get your free pass... so it's not as bad as a complete UA block, it seems.

@anarcat
Copy link
Contributor Author

anarcat commented Jul 17, 2017

PR coming up in #2634.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature features we would like to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants