moehmeni / syncedlyrics

Get an LRC format (synchronized) lyrics for your music
MIT License
188 stars 18 forks source link

Add provider Genius.com #27

Closed deedy5 closed 3 months ago

deedy5 commented 4 months ago

1) request api for url https://genius.com/api/search/multi?per_page=5&q=macarena see artist_names, full_title, url 2) parse url https://genius.com/Los-del-rio-macarena-lyrics

moehmeni commented 3 months ago

Thanks for the suggestion. It works on my machine [1] but fails the tests when querying step 1. I tested with both requests and curl_cffi. Logs showed it gets 403 status code for step 1.

[1] https://github.com/moehmeni/syncedlyrics/blob/main/syncedlyrics/providers/genius.py

deedy5 commented 3 months ago

Try with curl-cffi, but use impersonate self.session = requests.Session(impersonate="chrome")

moehmeni commented 3 months ago

If I use curl-cffi, I get an error mentioned in #29 in local. Also, the workflow test (with impersonate) could not pass as well.

deedy5 commented 3 months ago
curl_cffi.requests.errors.RequestsError: Failed to perform, curl: (55) Recv failure: Connection reset by peer. See https://curl.se/libcurl/c/libcurl-errors.html first for more details.

look https://curl.se/libcurl/c/libcurl-errors.html

CURLE_SEND_ERROR (55)

Failed sending network data. 

def get_lrc() Unclear problem. Are you sure a cookie is needed here? Try to add logging before each line that returns None to see what happens.

moehmeni commented 3 months ago

I commented out the tests for Genius for now, but in action, can you please confirm it works with -p Genius?

deedy5 commented 3 months ago

1) megalobiz.com site's not working anymore, it says :megalobiz.com has expired, 2) genius tests work.