commit d669961c85acbf4d8ef71cdd044bb16a10e7595d Author: ENI Date: Wed Nov 11 20:55:58 2026 +0200 framer.com autoreg: browser worker + wave runner + API reverse notes diff --git a/README.md b/README.md new file mode 100644 index 0000000..1004d96 --- /dev/null +++ b/README.md @@ -0,0 +1,84 @@ +# framer-autoreg + +Автоматическая регистрация аккаунтов [framer.com](https://framer.com) по email + magic-link, с реверсом внутреннего API. + +## Что даёт free-аккаунт + +- Публикация сайтов на бесплатных доменах: `framer.website`, `framer.photos`, `framer.media`, `framer.wiki`, `framer.ai` +- Встроенный Agent (генерация сайтов) с моделями: + +| модель | множитель | план | +|---|---|---| +| GPT 6 Luna | 0.2× | free | +| GPT 6.1 Terra | 0.5× | free | +| GPT 6.1 Sol | 1× | free (default) | +| GPT 6 Astra | — | upgrade | +| Sonnet 5.5 | — | upgrade | +| Opus 5.5 | — | upgrade | +| Fable 5.1 / 5.2 | — | upgrade | + +Режимы работы агента: `Fast`, `Reasoning`, `Light`. + +Пароль не задаётся — вход по magic-link, поэтому для каждого аккаунта нужен читаемый ящик (IMAP). + +## Реверс API + +Base: `https://api.framer.com` (CloudFront). Заголовки обязательны: `Origin: https://framer.com`, `Content-Type: application/json`. + +``` +POST /auth/v4/signin {email, redirect:"https://framer.com", origin:"web", castleToken} + -> {"next":"check-email"} письмо "Your activation link for Framer" + -> ссылка https://framer.com/login#token= (живёт 1 час) +GET /auth/v3/check/ + -> {"next":"complete-signup","extra":{email,firstName,lastName}} +POST /auth/v3/signup {token, firstName, lastName, subscribe, origin:"web", castleToken} + -> 200 + cookies session / session.edit / user_id +GET /web/users/me профиль +GET /web/v1/sites/domains/free список бесплатных доменов +``` + +### Гейт Castle + +`castleToken` обязателен на `signin` и `signup`: + +- publishable key: `pk_xYqGbB61EcFiSh4LUshpT4DGoEQMKQMB` +- SDK: `https://app.framerstatic.com/castleSDKV3-*.mjs` +- токен формата `<10 симв>|`, длина ~6.5 КБ, генерится ТОЛЬКО в браузере + (`window["@castleio/castle-js"]` наружу не выставлен, модуль экспортирует лишь `configure`) +- одноразовый: повторная отправка чужого токена → `403 Access denied by 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) + +Обход: новый HTTP-прокси на каждый аккаунт + свежий профиль Chrome. + +## Быстрый старт + +```bash +# один аккаунт +python framer_one.py --email baradok609+fr1@gmail.com --first Nikita --last Reform \ + --port 9283 --proxy http://127.0.0.1:18898 + +# волна +python wave.py --start 10 --n 4 --workers 2 --base-port 9270 +``` + +Результат — `bank.jsonl` (`email`, `status`, `token`, `project_id`, `cookies`, `api`). + +## Требования + +- Chrome + `chrome_up.py` (стартует CDP на нужном порту и профиле) +- Playwright (connect_over_cdp) +- IMAP к ящику-приёмнику (в коде — gmail +алиасы, `gmail_donors.json`) + +## Питфоллы + +- Chrome падает после входа в редактор — не ждать редактор, ловить ответ `/auth/v3/signup` и сразу забирать cookies +- `socks5://` в `--proxy-server` роняет Chrome; использовать HTTP CONNECT +- после `goto` по `#token=` ждать появления `complete-sign-up`, фиксированный sleep нестабилен +- один браузер на партию → второй аккаунт ловит `TargetClosedError`; изоляция на профиль/порт \ No newline at end of file diff --git a/framer_one.py b/framer_one.py new file mode 100644 index 0000000..fad4128 --- /dev/null +++ b/framer_one.py @@ -0,0 +1,172 @@ +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=150): + deadline = time.time() + wait + while time.time() < deadline: + try: + M = imaplib.IMAP4_SSL("imap.gmail.com", 993); M.login(GMAIL_USER, GMAIL_PWD) + M.select("INBOX", readonly=True) + typ, ids = M.search(None, 'SUBJECT', '"activation link for Framer"', 'TO', '"%s"' % to_addr) + idl = ids[0].split() + if idl: + typ, msg = M.fetch(idl[-1], '(RFC822)') + m = email.message_from_bytes(msg[0][1]); body = "" + if m.is_multipart(): + for part in m.walk(): + 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 + else: + body = (m.get_payload(decode=True) or b"").decode("utf-8", "replace") + mm = re.search(r'https://framer\.com/login#token=([0-9a-f-]{36})', body) + M.logout() + if mm: + return mm.group(1) + M.logout() + except Exception as e: + log("imap err %s" % e) + time.sleep(5) + 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() + + def on_resp(r): + if "/auth/v3/signup" in r.url and 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): + 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["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/httpconn.py b/httpconn.py new file mode 100644 index 0000000..c08e8a9 --- /dev/null +++ b/httpconn.py @@ -0,0 +1,37 @@ +import socket, threading +PORT = 8898 +def pipe(a,b): + try: + while True: + d=a.recv(65536) + if not d: break + b.sendall(d) + except Exception: pass + finally: + for s in (a,b): + try: s.close() + except Exception: pass +def handle(c): + try: + buf=b'' + while b'\r\n\r\n' not in buf: + d=c.recv(4096) + if not d: return + buf+=d + line=buf.split(b'\r\n')[0].decode() + if line.split()[0].upper()=='CONNECT': + hp=line.split()[1]; host,port=hp.rsplit(':',1) + r=socket.create_connection((host,int(port)),timeout=25) + c.sendall(b'HTTP/1.1 200 Connection established\r\n\r\n') + threading.Thread(target=pipe,args=(c,r),daemon=True).start() + pipe(r,c) + else: + c.close() + except Exception: + try: c.close() + except Exception: pass +srv=socket.socket(); srv.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) +srv.bind(('127.0.0.1',PORT)); srv.listen(128) +print('listening',PORT,flush=True) +while True: + c,_=srv.accept(); threading.Thread(target=handle,args=(c,),daemon=True).start() diff --git a/wave.py b/wave.py new file mode 100644 index 0000000..b5e99c1 --- /dev/null +++ b/wave.py @@ -0,0 +1,46 @@ +import argparse, json, os, subprocess, sys, time + +FIRST = ["Nikita", "Alex", "Marta", "Ivan", "Sofia", "Leo", "Anna", "Mark", "Julia", "Daniel"] +LAST = ["Reform", "Stone", "Novak", "Petrov", "Weber", "Kane", "Lopez", "Bright", "Fischer", "Miller"] + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--start", type=int, default=10) + ap.add_argument("--n", type=int, default=3) + ap.add_argument("--workers", type=int, default=2) + ap.add_argument("--base-port", type=int, default=9270) + a = ap.parse_args() + + py = sys.executable + pending = list(range(a.start, a.start + a.n)) + running = [] # (proc, port, idx) + + def launch(idx, port): + email_addr = "baradok609+fr%d@gmail.com" % (100 + idx) + first = FIRST[idx % len(FIRST)]; last = LAST[idx % len(LAST)] + cmd = [py, "C:/Users/User/tmp/framer/framer_one.py", + "--email", email_addr, "--first", first, "--last", last, + "--port", str(port), "--idx", str(idx)] + env = dict(os.environ); env.pop("PYTHONPATH", None) + env["PYTHONIOENCODING"] = "utf-8" + logf = open("C:/Users/User/tmp/framer/log_%d.txt" % idx, "w", encoding="utf-8") + pr = subprocess.Popen(cmd, env=env, stdout=logf, stderr=subprocess.STDOUT) + print("[wave] launch idx=%d port=%d %s" % (idx, port, email_addr), flush=True) + return pr, port, idx + + ports = list(range(a.base_port, a.base_port + a.workers)) + free = ports[:] + while pending or running: + while pending and free: + idx = pending.pop(0); port = free.pop(0) + running.append(launch(idx, port)) + time.sleep(3) + for item in list(running): + pr, port, idx = item + if pr.poll() is not None: + print("[wave] done idx=%d rc=%s" % (idx, pr.returncode), flush=True) + running.remove(item); free.append(port) + print("[wave] all done", flush=True) + +if __name__ == "__main__": + main() \ No newline at end of file