fix: robust final block (safe screenshot/close), IMAP host param, env-driven paths; README: live run log 31.10

This commit is contained in:
2026-10-31 21:29:29 +00:00
parent 98f726d4b6
commit 49f8b32d3c
2 changed files with 25 additions and 2 deletions
+8 -2
View File
@@ -183,7 +183,10 @@ with sync_playwright() as p:
log("final page:", txt(pg, 200).replace("\n", " "), "|", pg.url[:80])
if "blocked" not in txt(pg, 320):
ok = True
pg.screenshot(path=os.path.join(BASE, "z_final.png"))
try:
pg.screenshot(path=os.path.join(BASE, "z_final.png"), timeout=15000)
except Exception as _e:
log("shot err", type(_e).__name__)
try:
ks = pg.evaluate("() => (document.body.innerText.match(/ctxt_secret_[A-Za-z0-9]+/g) || null)")
log("keys on page:", ks)
@@ -192,7 +195,10 @@ with sync_playwright() as p:
pg.url + "\n\n" + full)
except Exception as e:
log("dump err", type(e).__name__)
pg.close()
try:
pg.close()
except Exception:
pass
used.add(MAIL); json.dump(sorted(used), open(USED, "w"))
j = {}