farshed / genius-lyrics-api

A library for "fetching" song lyrics & album covers from genius.com 🎤 🎶
MIT License
221 stars 37 forks source link

Error 403 (Captcha) #24

Open nicokimmel opened 2 years ago

nicokimmel commented 2 years ago

I got the same problem as one of the closed (and never solved) issues. Its working on my computer but when I push it to the server it only returns 403. Maybe its the reverse proxy that causes the issue. It returns html that contains some sort of captcha.

Code is quite simple:

const genius = require('genius-lyrics-api')

function getLyrics(title) {
    var searchOptions = {
        title: title,
        artist: " ",
        apiKey: "XXX",
        optimizeQuery: true
    }
    genius.getLyrics(searchOptions).then((lyrics) => {
        console.log(lyrics);
    });
}

Originally posted by @nicokimmel in https://github.com/farshed/genius-lyrics-api/issues/21#issuecomment-1013609298

mepc36 commented 2 years ago

Seeing the same issue, find any fix?

jrejaud commented 2 years ago

Same here.

DAREALYTYGRUNN1NGARK456 commented 2 years ago

i am also getting this error i was able to use it before but now i cannot use it on any server i tried one from https://bluefoxhost.com and https://replit.com

jrejaud commented 2 years ago

I fixed it by running my calls through a rotating proxy

farshed commented 1 year ago

May I ask where your server is hosted? And is the captcha returned when you make too many requests or even on the first one?

It could be that Genius's firewall is blacklisting the popular server hosting IPs and is thus aware that a request originating from there is likely coming from a bot. I'm afraid there's not much that I can do here. Try looking into whether it's possible to hide your IP from the requests.