codemanki / cloudscraper

--DEPRECATED -- 🛑 🛑 Node.js library to bypass cloudflare's anti-ddos page
MIT License
603 stars 141 forks source link

Getting 403 on the captcha challenge page even when specifying an onCaptcha callback #291

Closed Bassintag closed 5 years ago

Bassintag commented 5 years ago

Cloudscraper version: v4.4.0 Node version: v12.10.0 URL: https://raffle.bstn.com/

When accessing this page the captcha page is always required, before last cloudflare update cloudscraper would work fine by sending the challenge for it to be solved but since the recent update it just throws a StatusCodeError (status being 403).

const headers = {
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0',
            'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Language': 'en-US,en;q=0.5',
            'Accept-Encoding': 'gzip',
            'Connection': 'keep-alive',
            'Upgrade-Insecure-Requests': '1',
            'TE': 'Trailers',
};
const session = request.defaults({
            followAllRedirects: true,
            jar: request.jar(),
            gzip: true,
            onCaptcha() { console.log('test'); /* Not actual code but never called */ },
            headers,
});
const page = await session.get({
            uri: registerUrl,
});
Eastkap commented 5 years ago

Are you sure you are using the cloudscraper library ? From what I can see you are only using the requests one :( Also, it looks to me you are making a bad bot ;)

kr4ssi commented 5 years ago

I get "Cloudflare challenge loop" Error

minas90 commented 5 years ago

I have the same or similar issue for this website right now: https://censor.net.ua/ CloudFlare is active for it for an hour or so. It's working fine locally, but on aws ec2 instance I get error: CaptchaError: captcha Also when I do wget locally, I get status 503, but on ec2 I get 403: Forbidden

What can be wrong? Maybe it's blocked for some specific location?

Eastkap commented 5 years ago

What’s your wget command? @minas90 You should get the same status code or at least not a 5xx even with curl/wget

@kr4ssi could you give more details about your request/code/ library version etc?

SFx2018 commented 5 years ago

I have same error (403) for ogusers.com since few days :<

codemanki commented 5 years ago

4.5.0 was just published

SFx2018 commented 5 years ago

it works now, but I'm getting captcha loop, I think this issue is not related to this library ;<

minas90 commented 5 years ago

@Eastkap wget https://censor.net.ua/

When CloudFlare is active for a website, I usually get 503. Actually it's how I detect if CF is active to use CloudScraper. For the first time I saw 403 in logs when CF is active. When I tested locally I got 503. I tried to use VPN in SF, as my ec2 is in the US, I still got 503. So I was not able to understand what's happening. The website disabled CF already, so I will wait for the next time to understand what's happening. :)