Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script silently fails when timed out on login API request when 403'd from Cloudflare #42

Open
WittyjonWitty opened this issue Oct 24, 2023 · 3 comments

Comments

@WittyjonWitty
Copy link

Script times out after hanging on login, after HB username and password have been entered. See log below

Traceback (most recent call last):
File "D:\git\steamredeem\humble-steam-key-redeemer\humblesteamkeysredeemer.py", line 907, in
humble_login(driver)
File "D:\git\steamredeem\humble-steam-key-redeemer\humblesteamkeysredeemer.py", line 276, in humble_login
auth,login_json = do_login(driver,payload)
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\git\steamredeem\humble-steam-key-redeemer\humblesteamkeysredeemer.py", line 246, in do_login
auth,login_json = perform_post(driver,HUMBLE_LOGIN_API,payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\git\steamredeem\humble-steam-key-redeemer\humblesteamkeysredeemer.py", line 131, in perform_post
return driver.execute_async_script(fetch_cmd.format(formData=json_payload,url=url,csrf=csrf))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jwitt\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 423, in execute_async_script
return self.execute(command, {"script": script, "args": converted_args})["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jwitt\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 344, in execute
self.error_handler.check_response(response)
File "C:\Users\Jwitt\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: script timeout
(Session info: chrome=118.0.5993.89)
Stacktrace:
GetHandleVerifier [0x00007FF7E0468EF2+54786]
(No symbol) [0x00007FF7E03D5612]
(No symbol) [0x00007FF7E028A4FD]
(No symbol) [0x00007FF7E0305A0A]
(No symbol) [0x00007FF7E02EBE6A]
(No symbol) [0x00007FF7E0304D02]
(No symbol) [0x00007FF7E02EBC43]
(No symbol) [0x00007FF7E02C0941]
(No symbol) [0x00007FF7E02C1B84]
GetHandleVerifier [0x00007FF7E07B7F52+3524194]
GetHandleVerifier [0x00007FF7E080D800+3874576]
GetHandleVerifier [0x00007FF7E0805D7F+3843215]
GetHandleVerifier [0x00007FF7E0505086+694166]
(No symbol) [0x00007FF7E03E0A88]
(No symbol) [0x00007FF7E03DCA94]
(No symbol) [0x00007FF7E03DCBC2]
(No symbol) [0x00007FF7E03CCC83]
BaseThreadInitThunk [0x00007FFDB171257D+29]
RtlUserThreadStart [0x00007FFDB208AA78+40]

@FatePony
Copy link

FatePony commented Nov 9, 2023

I am getting the same error, but I've already logged in and was re-running it after this month's drop. Deleting the session files did not fix it. This error seems to be the culprit, selenium.common.exceptions.TimeoutException: Message: script timeout. My stacktrace is the same as you.

@N1ghtm4r3x
Copy link

Download this chromedriver 114.0.5735.90 for windows, unzip it and place the chromedriver in the same folder as the python script, it should work after that.

@FailSpy
Copy link
Owner

FailSpy commented Feb 27, 2024

This is due to Chrome v115 and above becoming quite obvious to Cloudflare's bot detection with their new 'Chrome for Testing' mode. I'm working on a fix to make it so this doesn't fail so silently going forwards.

As a hotfix, I've made it so the script prefers FirefoxDriver as that seems to be working still. Then rely on Selenium Manager to hopefully magically make that work on most users machines.

I'm leaving this issue open for now until I fix the quiet failure mentioned here, and hopefully at that point also have a better answer for going forwards.

@FailSpy FailSpy changed the title Script timeout on login Script silently fails when timed out on login API request when 403'd from Cloudflare Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants