diff --git a/main.py b/main.py index 53be6ae..ec6d6a5 100644 --- a/main.py +++ b/main.py @@ -587,6 +587,13 @@ def process_account(driver, acc: dict, donor_video: Path | None, log.info("Clicked selfie Continue") time.sleep(3) break + except Exception: + pass + try: + driver.find_element(By.XPATH, "//button[contains(@data-test, 'selfie') or contains(@aria-label, 'camera')]").click() + log.info("Clicked selfie Continue (fallback)") + time.sleep(3) + break except Exception: time.sleep(1) @@ -595,12 +602,20 @@ def process_account(driver, acc: dict, donor_video: Path | None, try: alert = driver.find_element(By.XPATH, "//span[@role='alert']") txt = alert.text.lower() - if "center" in txt or "центр" in txt: + if "center" in txt or "центр" in txt or "look" in txt: driver.execute_script("window.__startVideo();") log.info("Center instruction detected, video started") break except Exception: pass + try: + body = driver.find_element(By.TAG_NAME, "body") + if "center" in body.text.lower() or "центр" in body.text.lower() or "look straight" in body.text.lower(): + driver.execute_script("window.__startVideo();") + log.info("Center instruction detected (body fallback), video started") + break + except Exception: + pass time.sleep(1) end_time = time.time() + 120 @@ -731,7 +746,7 @@ def _process_one(tid: int, acc: dict, driver = None try: with _chrome_lock: - driver = uc.Chrome(options=options, headless=False, version_main=149) + driver = uc.Chrome(options=options, headless=False) result = process_account(driver, acc, donor_video, frames_b64, fw, fh, dir_ranges, speed_multiplier) if result == "verified": log.info("[T%d] Account verified", tid) @@ -752,6 +767,10 @@ def _process_one(tid: int, acc: dict, driver.quit() except Exception: pass + try: + driver.__class__.__del__ = lambda s: None + except Exception: + pass if pproxy_proc: pproxy_proc.terminate()