shihabmridha / educative.io-downloader

Free Palestine. 📖 This tool is to download course from educative.io for offline usage. It uses your login credentials and download the course.
218 stars 130 forks source link

Cannot log in, cmd automatically closes. #72

Closed RahilRehan closed 4 years ago

RahilRehan commented 4 years ago

I tried setting headless false, and this is what I saw error2

And here is the log 2020-08-27T05_55_28_150Z-debug.log

Maybe it is some error related to re-captcha? Please have a look.

RahilRehan commented 4 years ago

I can normally login with same details in my chrome browser. It used to perfectly worked two days ago. I did try recompiling, tried on linux and windows too and tried deleting the data folder too. sometimes it magically works and sometimes it throws the access denied error.

RahilRehan commented 4 years ago

ok, following up. I just had a chat with educative support. I think they have introduced bot detection so to get rid of automation and scrapping.

I tried setting the userAgent on page, which did not work

const userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36';
await page.setUserAgent(userAgent);
RahilRehan commented 4 years ago

Maybe this will work, I don't know typescript. Can you please have a look? https://www.npmjs.com/package/puppeteer-extra-plugin-stealth

RahilRehan commented 4 years ago

Ok, so I found a solution. Basically educative uses recaptcha 3, which is quite intelligent. I replaced all chromium files with chrome installation in my pc, node_modules>pupeteer>local-chromium>win_build>chrome_win. That does the job, chrome is not getting flagged by recaptcha but like chromium.