Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
146609bbae | ||
|
|
cd712e992d | ||
|
|
872acb8449 |
@@ -311,12 +311,19 @@ def _cookie_login(driver, cookie: str) -> bool:
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
driver.execute_cdp_cmd("Network.setCookie", {
|
||||
"name": ".ROBLOSECURITY",
|
||||
"value": cookie,
|
||||
"domain": ".roblox.com",
|
||||
"path": "/",
|
||||
"secure": True,
|
||||
"httpOnly": True,
|
||||
})
|
||||
except Exception:
|
||||
driver.add_cookie({"name": ".ROBLOSECURITY", "value": cookie, "domain": ".roblox.com"})
|
||||
driver.get("https://www.roblox.com/home")
|
||||
time.sleep(3)
|
||||
time.sleep(4)
|
||||
return "/login" not in driver.current_url
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
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:
|
||||
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")))
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user