codemanki / cloudscraper

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

Cloudflare error: 1020, access Denied #330

Open Bojack92160 opened 4 years ago

Bojack92160 commented 4 years ago

Cloudscraper version: 4.6.0

I am basicaly in the same situation than #266 (same link and everything): can't post request to http://haapi.ankama.com/json/Ankama/v2/Api/CreateApiKey . I tried to add cipher strings like so:

cloudscraper.defaultParams.agentOptions.ciphers += ':!ECDHE+SHA:!AES128-SHA:!AESCCM:!DHE:!ARIA';

but I still get 1020 error. Here is all my code:

const cloudscraper = require('cloudscraper');
 cloudscraper.defaultParams.agentOptions.ciphers += ':!ECDHE+SHA:!AES128-SHA:!AESCCM:!DHE:!ARIA';

async function getapikey(log, mdp, Proxy) {
   try {
     let url = "https://haapi.ankama.com/json/Ankama/v2/Api/CreateApiKey";
     let options = {
       uri: url,
       proxy: Proxy,
       formData: {
         login: log,
         password: mdp,
         long_life_token: "false"
       }
     };
     let response = JSON.parse(await cloudscraper.post(options));
     console.log("APIKEY:", response.key);
     return response.key;
   } catch (error) {
     console.log(error.stack);
   }
}

getapikey("AccountName","Pswd",null);
wiktorpikosz commented 4 years ago

I have very similarly a bug. But it's when I use nodejs 10. On nodejs 8.X works fine. It's very interesting and I can't fine a solution for this problem.

mdashlw commented 4 years ago

Started getting the same error a few hours ago. From different IPs. Website works on my local pc, however when I set up proxy on my own server that never made any requests to the website, I started getting this error. Tried downgrading, using some ciphers from similar issues - nothing worked. Getting 1020 error even when using plain request without cloudscraper. image