Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f161dbbbd5 | ||
|
|
b29b438df3 | ||
|
|
4798f706b8 |
@@ -390,7 +390,9 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
camera_btn = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.XPATH, "//span[text()='Continue with camera']/ancestor::button")))
|
camera_btn = WebDriverWait(driver, 15).until(
|
||||||
|
EC.element_to_be_clickable((By.XPATH, "//button[contains(@class, 'age-verification-button')]"))
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
camera_btn.click()
|
camera_btn.click()
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -430,8 +432,8 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
)
|
)
|
||||||
log.info("Persona iframe found")
|
log.info("Persona iframe found")
|
||||||
except Exception:
|
except Exception:
|
||||||
log.warning("Persona widget iframe not found")
|
log.warning("Persona widget iframe not found, will retry")
|
||||||
return False
|
return True
|
||||||
|
|
||||||
if frames_b64 is None and donor_video:
|
if frames_b64 is None and donor_video:
|
||||||
w, h = _get_video_size(donor_video)
|
w, h = _get_video_size(donor_video)
|
||||||
@@ -585,6 +587,13 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
log.info("Clicked selfie Continue")
|
log.info("Clicked selfie Continue")
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
break
|
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:
|
except Exception:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
@@ -593,12 +602,20 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
try:
|
try:
|
||||||
alert = driver.find_element(By.XPATH, "//span[@role='alert']")
|
alert = driver.find_element(By.XPATH, "//span[@role='alert']")
|
||||||
txt = alert.text.lower()
|
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();")
|
driver.execute_script("window.__startVideo();")
|
||||||
log.info("Center instruction detected, video started")
|
log.info("Center instruction detected, video started")
|
||||||
break
|
break
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
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)
|
time.sleep(1)
|
||||||
|
|
||||||
end_time = time.time() + 120
|
end_time = time.time() + 120
|
||||||
@@ -660,9 +677,9 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
log.info("No decline message — pending (wait for days)")
|
log.info("Verification timed out — restarting")
|
||||||
save_result(acc, "pending", "no result in 120s loop")
|
save_result(acc, "pending", "no result in 120s loop")
|
||||||
return False
|
return True
|
||||||
|
|
||||||
|
|
||||||
def ensure_files() -> None:
|
def ensure_files() -> None:
|
||||||
@@ -729,7 +746,7 @@ def _process_one(tid: int, acc: dict,
|
|||||||
driver = None
|
driver = None
|
||||||
try:
|
try:
|
||||||
with _chrome_lock:
|
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)
|
result = process_account(driver, acc, donor_video, frames_b64, fw, fh, dir_ranges, speed_multiplier)
|
||||||
if result == "verified":
|
if result == "verified":
|
||||||
log.info("[T%d] Account verified", tid)
|
log.info("[T%d] Account verified", tid)
|
||||||
@@ -750,6 +767,10 @@ def _process_one(tid: int, acc: dict,
|
|||||||
driver.quit()
|
driver.quit()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
driver.__class__.__del__ = lambda s: None
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
if pproxy_proc:
|
if pproxy_proc:
|
||||||
pproxy_proc.terminate()
|
pproxy_proc.terminate()
|
||||||
|
|||||||
Reference in New Issue
Block a user