mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2026-11-10 12:28:21 +00:00
Add small random jitter to turnstile key press timings (#1797)
This commit is contained in:
1 parent
c96b3c85ab
commit
a96b2c4644
1 file changed
+4
-3
@@ -4,6 +4,7 @@ import sys
|
|||||||
import time
|
import time
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from html import escape
|
from html import escape
|
||||||
|
from random import uniform
|
||||||
from urllib.parse import unquote, quote
|
from urllib.parse import unquote, quote
|
||||||
|
|
||||||
from func_timeout import FunctionTimedOut, func_timeout
|
from func_timeout import FunctionTimedOut, func_timeout
|
||||||
@@ -261,10 +262,10 @@ def click_verify(driver: WebDriver, num_tabs: int = 1):
|
|||||||
try:
|
try:
|
||||||
logging.debug("Try to find the Cloudflare verify checkbox...")
|
logging.debug("Try to find the Cloudflare verify checkbox...")
|
||||||
actions = ActionChains(driver)
|
actions = ActionChains(driver)
|
||||||
actions.pause(5)
|
actions.pause(5 + uniform(0.1, 0.5))
|
||||||
for _ in range(num_tabs):
|
for _ in range(num_tabs):
|
||||||
actions.send_keys(Keys.TAB).pause(0.1)
|
actions.send_keys(Keys.TAB).pause(0.1 + uniform(0.02, 0.1))
|
||||||
actions.pause(1)
|
actions.pause(1 + uniform(0.1, 0.5))
|
||||||
actions.send_keys(Keys.SPACE).perform()
|
actions.send_keys(Keys.SPACE).perform()
|
||||||
|
|
||||||
logging.debug(f"Cloudflare verify checkbox clicked after {num_tabs} tabs!")
|
logging.debug(f"Cloudflare verify checkbox clicked after {num_tabs} tabs!")
|
||||||
|
|||||||
Reference in new issue
Block a user