Author SHA1 Message Date
TheRaiwy f0a6b79a82 Retry on all errors (timeouts, crashes) instead of giving up
tests / test (push) Successful in 5s
tests / release (push) Successful in 6s
2026-07-10 20:47:57 +03:00
TheRaiwy 146609bbae Use CDP (execute_cdp_cmd) to set httpOnly cookie with fallback
tests / test (push) Successful in 5s
tests / release (push) Successful in 5s
2026-07-10 20:38:42 +03:00
+13 -11
View File
@@ -302,10 +302,8 @@ def save_result(acc: dict, category: str, msg: str = "") -> None:
def _cookie_login(driver, cookie: str) -> bool: def _cookie_login(driver, cookie: str) -> bool:
driver.get("https://www.roblox.com/home") driver.get("https://www.roblox.com")
time.sleep(2) time.sleep(2)
if "/login" not in driver.current_url:
return True
try: try:
accept = WebDriverWait(driver, 3).until(EC.element_to_be_clickable((By.XPATH, "//button[text()='Accept All']"))) accept = WebDriverWait(driver, 3).until(EC.element_to_be_clickable((By.XPATH, "//button[text()='Accept All']")))
accept.click() accept.click()
@@ -313,19 +311,19 @@ def _cookie_login(driver, cookie: str) -> bool:
except Exception: except Exception:
pass pass
try: try:
driver.add_cookie({ driver.execute_cdp_cmd("Network.setCookie", {
"name": ".ROBLOSECURITY", "name": ".ROBLOSECURITY",
"value": cookie, "value": cookie,
"domain": ".roblox.com", "domain": ".roblox.com",
"path": "/", "path": "/",
"secure": True, "secure": True,
"httpOnly": True,
}) })
driver.get("https://www.roblox.com/home") except Exception:
time.sleep(4) driver.add_cookie({"name": ".ROBLOSECURITY", "value": cookie, "domain": ".roblox.com"})
return "/login" not in driver.current_url driver.get("https://www.roblox.com/home")
except Exception as e: time.sleep(4)
log.warning("Cookie login error: %s", e) return "/login" not in driver.current_url
return False
def process_account(driver, acc: dict, donor_video: Path | None, def process_account(driver, acc: dict, donor_video: Path | None,
@@ -777,7 +775,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: