codemanki / cloudscraper

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

CaptchaError: captcha v4.0.1 (SSL negotiation) #211

Closed karnadii closed 5 years ago

karnadii commented 5 years ago
var uri = "https://nanime.in";
  var cloudscraper = require("cloudscraper").defaults({
    headers: {
      Connection: "keep-alive",
      "User-Agent":
        "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
      Accept:       "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
      "Accept-Language": "en-US,en;q=0.9"
    }
  });

  cloudscraper.get(uri, function(error, response, body) {
    if (error) {
      throw error;
      res.send(error);
      next();
    } else {
      console.log(body);

      res.send(body);
      next();
    }
  });

/media/karnadi/Boice/Proyek/scraper-api/node_modules/request-promise-core/lib/plumbing.js:130
            throw thrownException;
            ^
CaptchaError: captcha
ghost commented 5 years ago

Hey @karnadii,

I'm sorry to hear that. The README has been updated with information that may help avoid the CAPTCHA on other versions of Node.js: https://github.com/codemanki/cloudscraper#recaptcha

I believe I am not the only one facing this error, the error message is not helpful either, so at least inform user to update to newest version of node if they having the same error.

Unfortunately, it's not as simple as only updating Node.js to v12. Changing Node.js versions won't fix this issue for everybody as it is largely Device/Node.js version specific. Said another way, it is largely CPU features, OpenSSL version, Node.js default cipher suite specific.

These are the CAPTCHA issues that are TLS related: https://github.com/codemanki/cloudscraper/issues?utf8=✓&q=tls

Please try the tips mentioned in the README and report back whether they work for you. The more feedback we get, the better we'll know what to put in error messages.

Cheers.

karnadii commented 5 years ago

I really don't know about this tls thing. and I forget https://github.com/codemanki/cloudscraper#recaptcha is solving this issue. thanks for the explanation. it has been long since I last used cloudscraper and forget about this agentoptions things. and since this issue already closed, I thought I can use it without this agentoption.