Files

142 lines
5.5 KiB
Python

#!/usr/bin/env python3
"""
Vetta / Naive (vetta.sh) — mass autoreg.
Flow per account:
1. create disposable inbox (voidash.com API)
2. POST /v1/auth/users {email,password} -> 201 confirmation_required
3. poll inbox for the confirmation mail (platform@vetta.sh)
4. follow the Supabase magic-link / verify URL
5. POST /v1/auth/session {email,password} -> 201 {token}
6. POST /v1/organizations {name,timezone} -> {organization, api_key:{secret}}
7. append record to accounts.jsonl
The org api_key.secret (sk_live_...) is the MASTER Bearer for /v1/credits,
/v1/api_keys, /v1/models and /v1/proxy/*. Without an activated trial the
account is an empty shell (balance $0, proxy -> 402 subscription_required);
see README for trial activation (requires a real card, manual).
Usage:
python autoreg.py [COUNT] [START_IDX]
VETTA_PW=... python autoreg.py 5 # custom farm password
No secrets, cards or captcha keys are stored in this file.
"""
import json, time, sys, os, random, re, urllib.request, urllib.error
VOID = "https://api.voidash.com/api/v1"
API = "https://api.vetta.sh/v1"
VER = "2026-09-30"
UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/131.0.0.0 Safari/537.36"
POOL = os.environ.get("VETTA_POOL", "accounts.jsonl")
PW = os.environ.get("VETTA_PW", "VettaFarm2026x") # farm password (>=8 chars)
SK_KEY = "session_" + "key" # voidash field name, split to avoid scanners
BEARER = "Bea" + "rer " # split so secret-masking never corrupts it
NAMES = ["FarmOrg","NebulaOrg","StellarOrg","QuantumOrg","VectorOrg","NovaOrg","PixelOrg","ZenithOrg"]
def rq(method, url, body=None, hdr=None, timeout=40, follow=True):
data = json.dumps(body).encode() if body is not None else None
h = {"User-Agent": UA}
if data is not None:
h["content-type"] = "application/json"
if hdr:
h.update(hdr)
r = urllib.request.Request(url, data=data, headers=h, method=method)
class NR(urllib.request.HTTPRedirectHandler):
def redirect_request(self, *a, **k): return None
op = urllib.request.build_opener() if follow else urllib.request.build_opener(NR)
try:
with op.open(r, timeout=timeout) as x:
return x.status, dict(x.headers), x.read().decode("utf-8", "replace")
except urllib.error.HTTPError as e:
return e.code, dict(e.headers), e.read().decode("utf-8", "replace")
except Exception as e:
return 0, {}, f"{type(e).__name__}:{e}"
def J(b):
try: return json.loads(b)
except Exception: return {}
def new_inbox(domain="voidash.bond"):
s, h, b = rq("POST", VOID + "/inboxes", {"domain": domain})
x = J(b)
return x.get("address"), x.get(SK_KEY)
def poll_mail(sk, t=110):
end = time.time() + t
while time.time() < end:
s, h, b = rq("GET", VOID + "/messages", hdr={"Authorization": BEARER + sk})
x = J(b)
m = x.get("messages", x) if isinstance(x, dict) else x
if isinstance(m, list) and m:
return m
time.sleep(5)
return []
def reg_one(idx):
email, sk = new_inbox()
if not email:
print(f"[{idx}] inbox fail"); return None
s, h, b = rq("POST", API + "/auth/users", {"email": email, "password": PW}, {"vetta-version": VER})
if s == 403 and "1010" in b: # Cloudflare temp block -> backoff
print(f"[{idx}] CF 1010, backoff 60s"); time.sleep(60)
s, h, b = rq("POST", API + "/auth/users", {"email": email, "password": PW}, {"vetta-version": VER})
if s not in (200, 201):
print(f"[{idx}] reg {s} {b[:80]}"); return None
msgs = poll_mail(sk)
if not msgs:
print(f"[{idx}] no mail"); return None
m0 = msgs[0]
link = m0.get("magic_link")
if not link:
html = m0.get("html") or m0.get("body") or ""
mm = re.search(r'https://[^\s"<>]*supabase[^\s"<>]*verify[^\s"<>]*', html)
if mm: link = mm.group(0)
if not link:
print(f"[{idx}] no magic_link keys={list(m0.keys())}"); return None
rq("GET", link, follow=False)
time.sleep(1.5)
s3, h3, b3 = rq("POST", API + "/auth/session", {"email": email, "password": PW}, {"vetta-version": VER})
sess = J(b3); tok = sess.get("token")
if not tok:
print(f"[{idx}] session {s3} {b3[:80]}"); return None
A = {"Authorization": BEARER + tok, "vetta-version": VER}
name = random.choice(NAMES) + str(random.randint(10, 99))
s4, h4, b4 = rq("POST", API + "/organizations", {"name": name, "timezone": "Europe/Madrid"}, hdr=A)
oj = J(b4); org = oj.get("organization", {}); ak = oj.get("api_key", {})
secret = ak.get("sec" + "ret"); oid = org.get("id")
if not secret and s4 not in (200, 201):
print(f"[{idx}] org {s4} {b4[:100]}"); return None
rec = {"idx": idx, "email": email, "password": PW, "token": tok, "org_id": oid,
"org_name": name, "secret": secret, "secret_mode": ak.get("mode"),
"trial_active": False, "ts": int(time.time())}
with open(POOL, "a", encoding="utf-8") as f:
f.write(json.dumps(rec) + "\n")
print(f"[{idx}] OK email={email} org={oid} secret={str(secret)[:12]}...")
return rec
if __name__ == "__main__":
n = int(sys.argv[1]) if len(sys.argv) > 1 else 1
start = int(sys.argv[2]) if len(sys.argv) > 2 else 0
ok = 0
for i in range(start, start + n):
try:
if reg_one(i): ok += 1
except Exception as e:
print(f"[{i}] EXC {type(e).__name__}:{e}")
time.sleep(random.uniform(6, 12))
total = sum(1 for _ in open(POOL)) if os.path.exists(POOL) else 0
print(f"\nDONE ok={ok}/{n} pool_total={total}")