Files
river-autoreg/secondno_register.py
T
Exteriorgluform 01d9cc021b feat(secondno): working 2nd-no.com registration flow
- reg2no_fast.py: signup (BOTH password fields + checkbox -- _FILL_JS only
  filled one, confirm-empty blocked submit) -> save pending creds IMMEDIATELY
  (password survives t-online confirm-email lag) -> SENTSINCE email poll (420s)
  -> goto create-account link (fresh token, auto-creates) -> login -> reserve
- complete_pending_2no.py: finish pending accounts (login -> get_number -> state.json)
- complete_secondno.py: separate t-online IMAP password (read mail) from 2nd-no
  account password (login) -- was passing 2nd-no pw to IMAP -> login fail
- client.py: IMAP4_SSL timeout=30 (t-online throttle fail-fast), wait_email
  SENTSINCE+FROM fallback, SECONDNO_PROXY (fresh IP bypasses 2-per-IP signup limit)
- VERIFIED: signup 200 success, create-account 'Account created', login OK
  (/app/numbers), free number found via _call(310). Reserve needs turnstile
  token (sidecar/2captcha -- see captcha.py).
2026-10-21 00:30:13 +03:00

47 lines
1.6 KiB
Python

# -*- coding: utf-8 -*-
"""Register fresh 2nd-no.com account(s) into data/secondno/state.json.
Usage: python secondno_register.py [N] [--gmail]
default inbox: tempmail.lol (built-in, no config)
--gmail: catch-all domain -> ForwardEmail -> Gmail (needs GMAIL_ADDR, GMAIL_APP_PW, MAIL_DOMAIN env)
Each account = 3 free PL numbers / 3 days (renewed on SMS receipt).
Login wall is a React SPA -> playwright required (Python 3.11; PYTHONPATH="" on Windows).
Reservation turnstile: captcha sidecar :8877 (FREE) or 2captcha (TWOCAPTCHA_API_KEY).
These accounts feed `river_reg.py --phone secondno` (WorkOS Radar phone gate) and
any other phone-gated target via the SecondNoPhone provider.
"""
import json
import os
import sys
sys.stdout.reconfigure(encoding="utf-8")
ROOT = os.path.dirname(os.path.abspath(__file__))
os.environ.setdefault("SECONDNO_HOME", os.path.join(ROOT, "data", "secondno"))
sys.path.insert(0, ROOT)
from secondno import full_cycle, GmailForwardInbox, TOnlineIMAP # noqa: E402
def main():
args = [a for a in sys.argv[1:] if not a.startswith("--")]
n = int(args[0]) if args else 1
inbox_factory = None
if "--gmail" in sys.argv:
inbox_factory = GmailForwardInbox
elif "--tonline" in sys.argv:
inbox_factory = TOnlineIMAP
results = full_cycle(n, inbox_factory=inbox_factory, headless=True)
ok = 0
for r in results:
print(json.dumps(r, ensure_ascii=False), flush=True)
if not r.get("error"):
ok += 1
print(f"DONE {ok}/{n} accounts registered", flush=True)
sys.exit(0 if ok else 1)
if __name__ == "__main__":
main()