klept0 / MS-Rewards-Farmer

A simple bot that uses Selenium to farm M$ Rewards in Python
MIT License
237 stars 49 forks source link

[BUG] Brand new session 2FA login timeouts too quickly #168

Closed deftm0nk closed 2 months ago

deftm0nk commented 2 months ago

Before submitting a bug report...

Title

Branch

master

Commit

b989b1c

Describe the bug

Using -v to login and complete the 2FA, the window kept closing before I could get a chance to hit the button.

Copy and paste your error

2024-08-08 14:06:01,466 [DEBUG] in init 2024-08-08 14:06:06,607 [INFO] Screen size: 2020x1134 2024-08-08 14:06:06,607 [INFO] Device size: 1965x983 2024-08-08 14:06:06,689 [DEBUG] out init 2024-08-08 14:06:06,689 [DEBUG] in enter 2024-08-08 14:06:19,629 [INFO] [LOGIN] Logging-in... 2024-08-08 14:06:29,883 [DEBUG] in exit exc_type=<class 'selenium.common.exceptions.TimeoutException'> exc_value=Message: Stacktrace: 0 undetected_chromedriver 0x000000010e1db848 undetected_chromedriver + 5179464 1 undetected_chromedriver 0x000000010e1d327a undetected_chromedriver + 5145210 2 undetected_chromedriver 0x000000010dd4a2b0 undetected_chromedriver + 389808 3 undetected_chromedriver 0x000000010dd963e1 undetected_chromedriver + 701409 4 undetected_chromedriver 0x000000010dd96691 undetected_chromedriver + 702097 5 undetected_chromedriver 0x000000010ddd8464 undetected_chromedriver + 971876 6 undetected_chromedriver 0x000000010ddb87dd undetected_chromedriver + 841693 7 undetected_chromedriver 0x000000010ddd5b9b undetected_chromedriver + 961435 8 undetected_chromedriver 0x000000010ddb8553 undetected_chromedriver + 841043 9 undetected_chromedriver 0x000000010dd897f6 undetected_chromedriver + 649206 10 undetected_chromedriver 0x000000010dd8a05e undetected_chromedriver + 651358 11 undetected_chromedriver 0x000000010e19eab0 undetected_chromedriver + 4930224 12 undetected_chromedriver 0x000000010e1a39c6 undetected_chromedriver + 4950470 13 undetected_chromedriver 0x000000010e1a4095 undetected_chromedriver + 4952213 14 undetected_chromedriver 0x000000010e180e79 undetected_chromedriver + 4808313 15 undetected_chromedriver 0x000000010e1a4389 undetected_chromedriver + 4952969 16 undetected_chromedriver 0x000000010e1727d4 undetected_chromedriver + 4749268 17 undetected_chromedriver 0x000000010e1c3558 undetected_chromedriver + 5080408 18 undetected_chromedriver 0x000000010e1c3717 undetected_chromedriver + 5080855 19 undetected_chromedriver 0x000000010e1d2e5e undetected_chromedriver + 5144158 20 libsystem_pthread.dylib 0x00007ff80d8fc18b _pthread_start + 99 21 libsystem_pthread.dylib 0x00007ff80d8f7ae3 thread_start + 15 traceback=<traceback object at 0x108e67cc0> 2024-08-08 14:06:29,987 [ERROR] Traceback (most recent call last): File "/Users/joanne/Downloads/MS-Rewards-Farmer-master/main.py", line 39, in main earned_points = executeBot(currentAccount, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/joanne/Downloads/MS-Rewards-Farmer-master/main.py", line 236, in executeBot Login(desktopBrowser, args).login() File "/Users/joanne/Downloads/MS-Rewards-Farmer-master/src/login.py", line 29, in login self.executeLogin() File "/Users/joanne/Downloads/MS-Rewards-Farmer-master/src/login.py", line 35, in executeLogin self.utils.waitUntilVisible(By.ID, "i0116") File "/Users/joanne/Downloads/MS-Rewards-Farmer-master/src/utils.py", line 61, in waitUntilVisible return WebDriverWait(self.webdriver, timeToWait).until( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/selenium/webdriver/support/wait.py", line 105, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Stacktrace: 0 undetected_chromedriver 0x000000010e1db848 undetected_chromedriver + 5179464 1 undetected_chromedriver 0x000000010e1d327a undetected_chromedriver + 5145210 2 undetected_chromedriver 0x000000010dd4a2b0 undetected_chromedriver + 389808 3 undetected_chromedriver 0x000000010dd963e1 undetected_chromedriver + 701409 4 undetected_chromedriver 0x000000010dd96691 undetected_chromedriver + 702097 5 undetected_chromedriver 0x000000010ddd8464 undetected_chromedriver + 971876 6 undetected_chromedriver 0x000000010ddb87dd undetected_chromedriver + 841693 7 undetected_chromedriver 0x000000010ddd5b9b undetected_chromedriver + 961435 8 undetected_chromedriver 0x000000010ddb8553 undetected_chromedriver + 841043 9 undetected_chromedriver 0x000000010dd897f6 undetected_chromedriver + 649206 10 undetected_chromedriver 0x000000010dd8a05e undetected_chromedriver + 651358 11 undetected_chromedriver 0x000000010e19eab0 undetected_chromedriver + 4930224 12 undetected_chromedriver 0x000000010e1a39c6 undetected_chromedriver + 4950470 13 undetected_chromedriver 0x000000010e1a4095 undetected_chromedriver + 4952213 14 undetected_chromedriver 0x000000010e180e79 undetected_chromedriver + 4808313 15 undetected_chromedriver 0x000000010e1a4389 undetected_chromedriver + 4952969 16 undetected_chromedriver 0x000000010e1727d4 undetected_chromedriver + 4749268 17 undetected_chromedriver 0x000000010e1c3558 undetected_chromedriver + 5080408 18 undetected_chromedriver 0x000000010e1c3717 undetected_chromedriver + 5080855 19 undetected_chromedriver 0x000000010e1d2e5e undetected_chromedriver + 5144158 20 libsystem_pthread.dylib 0x00007ff80d8fc18b _pthread_start + 99 21 libsystem_pthread.dylib 0x00007ff80d8f7ae3 thread_start + 15

2024-08-08 14:06:30,481 [INFO] [POINTS] Data saved for the next day.

Screenshots

none because screen closes too quickly.

Value of dashboard variable

https://gist.github.com/deftm0nk/6cb3c562c501f8a1361041d1dafa6042

cal4 commented 2 months ago

Try develop branch to see if above fixes this issue

deftm0nk commented 2 months ago

Develop branch does fix it! Thanks!

cal4 commented 2 months ago

All credit to @GCMarvin, thanks!