drknzz / auto-lingo

A Duolingo Bot for automatic XP earning
MIT License
126 stars 40 forks source link

Login error #26

Open ashishtilak opened 1 year ago

ashishtilak commented 1 year ago

Unable to login through script since last few days. No issue in normal manual login. Tried disabling blink features, but no success: chrome_options.add_argument('--disable-blink-features=AutomationControlled')

login-error

theharshnemesis commented 1 year ago

This is because the bot uses chromedriver.. and google chrome being a crap browser lets websites know you're running the webdriver(you're using automation). Chrome literally allows the website to check for that flag and block logins and this week Duolingo started doing just that(If it detects webdriver, it will simply say wrong password, no matter what).

To make the bot work again, you must use any browser, that does not tell websites, what's none of their business(such as which extensions you run). One such browsers is firefox.

Selenium works just fine on firefox, you install extension and put the geckodriver.exe in the folder... but the script needs to be adjusted to work with geckodriver.exe. I have tried simply renaming it to chromedriver.exe, but still wont work.. it's not that easy.

ashishtilak commented 1 year ago

This is because the bot uses chromedriver.. and google chrome being a crap browser lets websites know you're running the webdriver(you're using automation). Chrome literally allows the website to check for that flag and block logins and this week Duolingo started doing just that(If it detects webdriver, it will simply say wrong password, no matter what).

To make the bot work again, you must use any browser, that does not tell websites, what's none of their business(such as which extensions you run). One such browsers is firefox.

Selenium works just fine on firefox, you install extension and put the geckodriver.exe in the folder... but the script needs to be adjusted to work with geckodriver.exe. I have tried simply renaming it to chromedriver.exe, but still wont work.. it's not that easy.

I have already tried using geckodriver, with required changes everywhere, but still same error. Even Firefox is not hiding the fact that we are using automation.

I'm exploring using undetected-chromedriver, will update.

drknzz commented 1 year ago

I'm exploring using undetected-chromedriver, will update.

Lovely. Let me know if you achieve any success.

theharshnemesis commented 1 year ago

This is because the bot uses chromedriver.. and google chrome being a crap browser lets websites know you're running the webdriver(you're using automation). Chrome literally allows the website to check for that flag and block logins and this week Duolingo started doing just that(If it detects webdriver, it will simply say wrong password, no matter what). To make the bot work again, you must use any browser, that does not tell websites, what's none of their business(such as which extensions you run). One such browsers is firefox. Selenium works just fine on firefox, you install extension and put the geckodriver.exe in the folder... but the script needs to be adjusted to work with geckodriver.exe. I have tried simply renaming it to chromedriver.exe, but still wont work.. it's not that easy.

I have already tried using geckodriver, with required changes everywhere, but still same error. Even Firefox is not hiding the fact that we are using automation.

I'm exploring using undetected-chromedriver, will update.

I tried undetected-chromedriver but I don't know how to install it, the instructions aren't clear. I tried downloading it and entering the command line mentioned in python, but I think it needs to be pointed to the folder the script is in, but I don't know how.

If you don't succeed with undetected-chromedriver maybe someone can try the injecting session cookie method, that I thought of and if you succeed, please post the instructions here.

The idea is to bypass the duo login screen altogether, that might work, unless they also force logout if chromedriver is detected.

theharshnemesis commented 1 year ago

Even if you could login now, the bot would not work. Since yesterday duolingo has removed the /stories page. I used the page to gain quick xp to stay in diamond league. On learn mode story xp is severly nerfed. I knew this day is coming, but they were sloppy about it, so I am still doing stories. I'm probably gonna write a autoit macro for it.

ashishtilak commented 1 year ago

Even if you could login now, the bot would not work. Since yesterday duolingo has removed the /stories page. I used the page to gain quick xp to stay in diamond league. On learn mode story xp is severly nerfed. I knew this day is coming, but they were sloppy about it, so I am still doing stories. I'm probably gonna write a autoit macro for it.

Yes. I was experimenting with undetected-chromedriver and was successful with stories. But since yesterday, that too has stopped. @theharshnemesis pl do share once you finish your work.