zyrouge / node-genius-lyrics

Simple lyrics fetcher that uses Genius. Also has official API implementations.
https://genius-lyrics.js.org
MIT License
61 stars 12 forks source link

Lyrics not working #40

Closed Tomato6966 closed 1 year ago

Tomato6966 commented 1 year ago

This is my initialization:

const lyrics = new Genius.Client(process.env.GENIUSTOKEN);

this is my command:

lyrics.songs.search("Omfori Skidder Skidder Skidder").then(async x => {
          return x?.length ? await x[0].lyrics() : null;
}); 

This is the output:

Error: No result was found

It is because this happens when u fetch the uri: https://milrato.com/codeshare/code/63a41dd1b7ad972a43f9380a

But when I open it in the BROWSER of the SERVER where I'M making the request of, it does not show cloudflare:

image

Please make it possible to change browser origin headers. So I can use the ones from my BROWSER (Firefox, linux, etc.) (defaultUserAgent ) because I'd need: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0

cause lyrics you scrape

Tomato6966 commented 1 year ago

just changing the defaultUserAgent, did not fix it maybe cookies could?

zyrouge commented 1 year ago

just changing the defaultUserAgent, did not fix it maybe cookies could?

Maybe. Cloudflare checks are not easy to bypass afaik.

Tomato6966 commented 1 year ago

It's not really a cloudflare check, it's more a google captcha

zyrouge commented 1 year ago

It's not really a cloudflare check, it's more a google captcha

No, it's actually Cloudflare Captcha.

Tomato6966 commented 1 year ago

Okay

Tomato6966 commented 1 year ago

If you could show me where to insert what, to test cookies, I can test it

zyrouge commented 1 year ago

Sample code for setting headers:

new Genius.Client("your_token", {
        requestOptions: {
            headers: {
                "user-agent": "your_custom_user_agent",
                cookie: "cookies",
            }
        }
    })
Tomato6966 commented 1 year ago

using cookies, doesnt fix it either

hmmm since I'm on ovh, I can't get lyrics anymore... sadge

Tomato6966 commented 1 year ago

Imma build some sort of a proxy cache wrapper then..

Thanks tho.

zyrouge commented 1 year ago

Closing this since this can't be fixed.