Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19a6c81e51 | ||
|
|
f0a6b79a82 | ||
|
|
146609bbae | ||
|
|
cd712e992d | ||
|
|
872acb8449 |
@@ -311,12 +311,19 @@ def _cookie_login(driver, cookie: str) -> bool:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
driver.add_cookie({"name": ".ROBLOSECURITY", "value": cookie, "domain": ".roblox.com"})
|
driver.execute_cdp_cmd("Network.setCookie", {
|
||||||
driver.get("https://www.roblox.com/home")
|
"name": ".ROBLOSECURITY",
|
||||||
time.sleep(3)
|
"value": cookie,
|
||||||
return "/login" not in driver.current_url
|
"domain": ".roblox.com",
|
||||||
|
"path": "/",
|
||||||
|
"secure": True,
|
||||||
|
"httpOnly": True,
|
||||||
|
})
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
driver.add_cookie({"name": ".ROBLOSECURITY", "value": cookie, "domain": ".roblox.com"})
|
||||||
|
driver.get("https://www.roblox.com/home")
|
||||||
|
time.sleep(4)
|
||||||
|
return "/login" not in driver.current_url
|
||||||
|
|
||||||
|
|
||||||
def process_account(driver, acc: dict, donor_video: Path | None,
|
def process_account(driver, acc: dict, donor_video: Path | None,
|
||||||
@@ -346,6 +353,17 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# close any modal dialogs blocking the login form
|
||||||
|
for _ in range(10):
|
||||||
|
try:
|
||||||
|
modal = driver.find_element(By.XPATH, "//h4[@class='modal-title']/ancestor::div[contains(@class, 'modal')]")
|
||||||
|
close_btn = modal.find_element(By.XPATH, ".//button[contains(@class, 'close')]")
|
||||||
|
close_btn.click()
|
||||||
|
log.info("Dismissed login modal")
|
||||||
|
time.sleep(1)
|
||||||
|
except Exception:
|
||||||
|
break
|
||||||
|
|
||||||
username_input = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, "login-username")))
|
username_input = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, "login-username")))
|
||||||
ActionChains(driver).move_to_element(username_input).pause(0.3).perform()
|
ActionChains(driver).move_to_element(username_input).pause(0.3).perform()
|
||||||
time.sleep(0.1); username_input.click(); time.sleep(0.1); username_input.clear()
|
time.sleep(0.1); username_input.click(); time.sleep(0.1); username_input.clear()
|
||||||
@@ -549,6 +567,7 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
_draw();
|
_draw();
|
||||||
}};
|
}};
|
||||||
window.__seekDirection = function(dir) {{ _currentDir = dir; }};
|
window.__seekDirection = function(dir) {{ _currentDir = dir; }};
|
||||||
|
window.__zoomOut = function() {{ _scaleX *= 0.99; _scaleY *= 0.99; }};
|
||||||
|
|
||||||
if (navigator.mediaDevices) {{
|
if (navigator.mediaDevices) {{
|
||||||
navigator.mediaDevices.getUserMedia = function(constraints) {{
|
navigator.mediaDevices.getUserMedia = function(constraints) {{
|
||||||
@@ -627,6 +646,10 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
log.info("Photo rejected, restarting browser")
|
log.info("Photo rejected, restarting browser")
|
||||||
driver.switch_to.default_content()
|
driver.switch_to.default_content()
|
||||||
return True
|
return True
|
||||||
|
if "further away" in body.lower() or "move back" in body.lower():
|
||||||
|
driver.execute_script("window.__zoomOut();")
|
||||||
|
log.info("Zoomed out (further away detected)")
|
||||||
|
time.sleep(1)
|
||||||
if "Session expired" in body:
|
if "Session expired" in body:
|
||||||
log.info("Session expired detected during verification")
|
log.info("Session expired detected during verification")
|
||||||
driver.switch_to.default_content()
|
driver.switch_to.default_content()
|
||||||
@@ -757,7 +780,11 @@ def _process_one(tid: int, acc: dict,
|
|||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error("[T%d] Error: %s", tid, e)
|
log.error("[T%d] Error: %s (attempt %d/%d)", tid, e, attempt + 1, max_retries)
|
||||||
|
if attempt + 1 < max_retries:
|
||||||
|
log.info("[T%d] Retrying after error...", tid)
|
||||||
|
time.sleep(5)
|
||||||
|
continue
|
||||||
break
|
break
|
||||||
finally:
|
finally:
|
||||||
if TEST_MODE:
|
if TEST_MODE:
|
||||||
|
|||||||
Reference in New Issue
Block a user