diff --git a/README.md b/README.md index 1004d96..b4b942a 100644 --- a/README.md +++ b/README.md @@ -47,15 +47,19 @@ GET /web/v1/sites/domains/free список бесплатных (`window["@castleio/castle-js"]` наружу не выставлен, модуль экспортирует лишь `configure`) - одноразовый: повторная отправка чужого токена → `403 Access denied by policy` -### Policy-гейт +### Policy-гейт (главный!) `POST /auth/v3/signup` возвращает `403 Access denied by policy` когда IP/устройство уже «прогрето» регистрациями: -- ~4 аккаунта на один egress, дальше отказ -- домашний IP и мобильный ZTE (89.209.x) — оба отработали -- рабочие лейны: `93.88.206.29` (squid :3128), `2.27.98.196` (http-connect :8898) +`403 Access denied by policy` приходит на **gmail +aliases** (`name+tag@gmail.com`) — это основная причина, а не IP. -Обход: новый HTTP-прокси на каждый аккаунт + свежий профиль Chrome. +- 4 аккаунта на `+fr7/+fr11/+fr12/+fr103` прошли, после чего домен gmail.com с плюс-алиасами начал отбиваться +- тот же отказ на домашнем IP, на мобильном ZTE (89.209.x) и на NL-проде `2.27.98.196` +- **t-online проходит стабильно**: `0402294270-0001@`, `060418906@` → signup 200, аккаунты живые +- рабочих лейнов два: `93.88.206.29` (squid :3128) и `2.27.98.196` (http-connect :8898) + +Рабочая схема: реальный почтовый ящик (t-online) + HTTP-прокси + свой профиль Chrome на аккаунт. +Письма t-online читаются только с VPS (`tonline_read.py` через ssh), локальный IMAP рвёт соединение. ## Быстрый старт diff --git a/framer_ton.py b/framer_ton.py new file mode 100644 index 0000000..feea4a3 --- /dev/null +++ b/framer_ton.py @@ -0,0 +1,182 @@ +import argparse, imaplib, email, json, os, re, subprocess, sys, time +from playwright.sync_api import sync_playwright + +GMAIL_USER = "baradok609@gmail.com" +CRED = json.load(open(r"C:/Users/User/tmp/cn_gpt_farm/gmail_donors.json", encoding="utf-8")) +GMAIL_PWD = CRED[GMAIL_USER] +BANK = "C:/Users/User/tmp/framer/bank.jsonl" + +def log(m): + print("[%s] %s" % (time.strftime("%H:%M:%S"), m), flush=True) + +def mail_token(to_addr, wait=180): + """Read Framer activation link through t-online IMAP on the VPS.""" + import subprocess as sp + creds = {} + for line in open(r"C:/Users/User/Desktop/avtoreg/working_mails.txt", encoding="utf-8", errors="replace"): + line = line.strip() + if not line or line.startswith("#") or ":" not in line: + continue + u, p = line.split(":", 1) + creds[u.lower()] = p + pwd = creds.get(to_addr.lower()) + if not pwd: + log("no creds for %s" % to_addr); return None + try: + r = sp.run(["ssh", "-o", "BatchMode=yes", "-o", "StrictHostKeyChecking=no", + "root@93.88.206.29", "python3 /root/tonline_read.py '%s' '%s' %d" % (to_addr, pwd, wait)], + capture_output=True, text=True, timeout=wait + 60) + out = (r.stdout or "").strip().splitlines() + for line in out: + if len(line) == 36 and line.count("-") == 4: + return line + log("reader said: %s" % (out[-1] if out else r.stderr[:120])) + except Exception as e: + log("ssh mail err %s" % e) + return None + +def click_continue(page): + return page.evaluate("() => { const b=[...document.querySelectorAll('button')].find(x=>(x.innerText||'').trim()==='Continue'); if(b){b.click();return true} return false }") + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--email", required=True) + ap.add_argument("--first", default="Nikita") + ap.add_argument("--last", default="Reform") + ap.add_argument("--port", default="9270") + ap.add_argument("--idx", default="0") + ap.add_argument("--proxy", default="") + a = ap.parse_args() + + prof = "C:/Users/User/tmp/framer/prof" + a.port + env = dict(os.environ); env["CTX_CDP_PORT"] = a.port; env["CTX_CHROME_PROF"] = prof + if a.proxy: env["CTX_CHROME_PROXY"] = a.proxy + subprocess.run([sys.executable, "C:/Users/User/tmp/agentrouter/chrome_up.py"], env=env, check=True) + + rec = {"email": a.email, "idx": a.idx, "ts": time.strftime("%Y-%m-%dT%H:%M:%S"), "status": "start"} + signup_ok = {"v": False} + + try: + with sync_playwright() as p: + br = p.chromium.connect_over_cdp("http://127.0.0.1:%s" % a.port) + ctx = br.contexts[0] + page = ctx.pages[0] if ctx.pages else ctx.new_page() + + su_info = {"status": None, "body": ""} + + def on_resp(r): + if "/auth/v3/signup" in r.url: + su_info["status"] = r.status + try: su_info["body"] = r.text()[:220] + except Exception: pass + if r.status < 400: + signup_ok["v"] = True + + page.on("response", on_resp) + + page.goto("https://framer.com/", wait_until="domcontentloaded", timeout=90000) + page.wait_for_timeout(3000) + page.goto("https://framer.com/login/", wait_until="domcontentloaded", timeout=90000) + page.wait_for_selector("#email", timeout=60000) + page.wait_for_timeout(5000) + for _ in range(6): + page.fill("#email", a.email) + page.wait_for_timeout(400) + if page.input_value("#email") == a.email: + break + page.wait_for_timeout(1000) + click_continue(page) + got = False + for _ in range(30): + page.wait_for_timeout(1000) + if "activate" in page.url or "check" in page.url: + got = True; break + if not got: + log("no activate page: %s" % page.url) + if not got: + rec["status"] = "signin_fail" + rec["detail"] = page.evaluate("()=>document.body.innerText.slice(0,200)").replace("\n", " ") + else: + tok = mail_token(a.email) + if not tok: + rec["status"] = "no_mail" + else: + rec["token"] = tok + ok_page = False + for _try in range(2): + try: + page.goto("https://framer.com/login#token=%s" % tok, wait_until="domcontentloaded", timeout=60000) + except Exception as e: + log("goto token err %s" % e); continue + for _ in range(28): + page.wait_for_timeout(1000) + try: + if "complete-sign-up" in page.url or page.query_selector("input[placeholder='First name']"): + ok_page = True; break + except Exception: + pass + if ok_page: break + if not ok_page: + rec["status"] = "activate_fail" + rec["detail"] = page.evaluate("()=>document.body.innerText.slice(0,200)").replace("\n", " ") + rec["url"] = page.url + else: + page.fill("input[placeholder='First name']", a.first, timeout=15000) + page.fill("input[placeholder='Last name']", a.last, timeout=15000) + page.wait_for_timeout(900) + for attempt in range(3): + if attempt == 2: + try: + page.click("button[type=submit]", force=True, timeout=6000) + except Exception as _e: + log("submit click err %s" % _e) + else: + click_continue(page) + for _ in range(20): + page.wait_for_timeout(500) + if signup_ok["v"] or "/projects/" in page.url: + break + if signup_ok["v"] or "/projects/" in page.url: + break + log("retry continue %d" % attempt) + page.wait_for_timeout(1200) + rec["signup_api_ok"] = signup_ok["v"] + rec["signup_status"] = su_info["status"] + rec["signup_body"] = su_info["body"] + rec["url"] = page.url + m = re.search(r'/projects/([A-Za-z0-9]+)', page.url) + rec["project_id"] = m.group(1) if m else None + try: + info = page.evaluate("""async () => { + const r = await fetch('https://api.framer.com/web/users/me', {credentials:'include'}); + if(!r.ok) return {err:r.status}; + const d = await r.json(); + return {id:d.id, name:d.name, email:d.email}; + }""") + rec["api"] = info + except Exception as e: + rec["api"] = {"err": str(e)} + rec["cookies"] = [{"name": c["name"], "value": c["value"], "domain": c["domain"]} for c in ctx.cookies()] + if signup_ok["v"] or (rec.get("api") or {}).get("id"): + rec["status"] = "ok" + else: + rec["status"] = "unconfirmed" + except Exception as e: + rec["status"] = rec["status"] if rec["status"] != "start" else "exc" + rec["detail"] = str(e) + + with open(BANK, "a", encoding="utf-8") as f: + f.write(json.dumps(rec, ensure_ascii=False) + "\n") + log("%s -> %s %s" % (a.email, rec["status"], rec.get("url") or rec.get("detail") or "")) + # kill this profile's chrome to free resources + try: + import psutil + for pr in psutil.process_iter(["cmdline"]): + cl = " ".join(pr.info.get("cmdline") or []) + if "remote-debugging-port=%s" % a.port in cl: + pr.kill() + except Exception: + pass + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tonline_read.py b/tonline_read.py new file mode 100644 index 0000000..1393031 --- /dev/null +++ b/tonline_read.py @@ -0,0 +1,27 @@ +import email, imaplib, re, sys, time +from email.header import decode_header +addr, pwd, wait = sys.argv[1], sys.argv[2], int(sys.argv[3]) if len(sys.argv) > 3 else 120 +dl = time.time() + wait +while time.time() < dl: + try: + M = imaplib.IMAP4_SSL('secureimap.t-online.de', 993) + M.login(addr, pwd) + M.select('INBOX', readonly=True) + typ, ids = M.search(None, 'FROM', 'framer') + idl = ids[0].split() + if idl: + typ, msg = M.fetch(idl[-1], '(RFC822)') + m = email.message_from_bytes(msg[0][1]) + body = '' + for part in (m.walk() if m.is_multipart() else [m]): + if part.get_content_type() in ('text/plain','text/html'): + try: body += part.get_payload(decode=True).decode(part.get_content_charset() or 'utf-8','replace') + except Exception: pass + mm = re.search(r'https://framer\.com/login#token=([0-9a-f-]{36})', body) + if mm: + print(mm.group(1)); M.logout(); sys.exit(0) + M.logout() + except Exception as e: + print('ERR', str(e)[:80], file=sys.stderr) + time.sleep(6) +print('NONE'); sys.exit(1)