LeagueOfPoro / EsportsCapsuleFarmer

Automatically watch all live matches on lolesports and farm Esports Capsules
https://www.youtube.com/c/LeagueOfPoro
Other
95 stars 23 forks source link

Headless mode not working #27

Closed ennsbq closed 1 year ago

ennsbq commented 1 year ago

I get incorrect credentials error if I'm using headless mode. If I set headless to false everything including autologin works. I don't have 2FA enabled.

INFO: 2022/07/26 08:34:14 - Using configuration from: ./config.yaml

DevTools listening on ws://127.0.0.1:54773/devtools/browser/6f1bf7b8-e7ad-4bab-9e4a-ae5f85ac0054
INFO: 2022/07/26 08:34:22 - Moving to login page
INFO: 2022/07/26 08:34:23 - Logging in
ERROR: 2022/07/26 08:34:43 - Automatic login failed, incorrect credentials?
INFO: 2022/07/26 08:34:45 - Exiting...
Traceback (most recent call last):
  File "main.py", line 174, in <module>
  File "main.py", line 76, in logIn
  File "selenium\webdriver\support\wait.py", line 90, in until
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
Backtrace:
        Ordinal0 [0x002C5FD3+2187219]
        Ordinal0 [0x0025E6D1+1763025]
        Ordinal0 [0x00173E78+802424]
        Ordinal0 [0x001A1C10+990224]
        Ordinal0 [0x001A1EAB+990891]
        Ordinal0 [0x001CEC92+1174674]
        Ordinal0 [0x001BCBD4+1100756]
        Ordinal0 [0x001CCFC2+1167298]
        Ordinal0 [0x001BC9A6+1100198]
        Ordinal0 [0x00196F80+946048]
        Ordinal0 [0x00197E76+949878]
        GetHandleVerifier [0x005690C2+2721218]
        GetHandleVerifier [0x0055AAF0+2662384]
        GetHandleVerifier [0x0035137A+526458]
        GetHandleVerifier [0x00350416+522518]
        Ordinal0 [0x00264EAB+1789611]
        Ordinal0 [0x002697A8+1808296]
        Ordinal0 [0x00269895+1808533]
        Ordinal0 [0x002726C1+1844929]
        BaseThreadInitThunk [0x75E36739+25]
        RtlGetFullPathName_UEx [0x77AB8FEF+1215]
        RtlGetFullPathName_UEx [0x77AB8FBD+1165]
        (No symbol) [0x00000000]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 180, in <module>
NameError: name 'exit' is not defined
[4972] Failed to execute script 'main' due to unhandled exception!

[process exited with code 1 (0x00000001)]
LeagueOfPoro commented 1 year ago

if you are comfortable with running the program through Python, add the following on line 74 of main.py and post the saved screenshot.

time.sleep(10)
driver.save_screenshot("screenshot.png")

It should look something like this:

...
log.info("Logging in")
time.sleep(10)
driver.save_screenshot("screenshot.png")
wait = WebDriverWait(driver, 20)
...
ennsbq commented 1 year ago

This is what I got.

EDIT: After setting config to "browser: firefox" headless mode works. Using chrome still gives me this error.

LeagueOfPoro commented 1 year ago

That is weird, I am glad the different browser resolved it though.