71 lines
3.2 KiB
Python
71 lines
3.2 KiB
Python
"""Batch-generate Stripe trial action_urls for all INACTIVE pool accounts.
|
|
|
|
Reads accounts.jsonl (gitignored — your local pool). For each account without an
|
|
active subscription, POSTs /v1/credits/subscription {plan:standard} via a real
|
|
browser context (same-origin fetch avoids Cloudflare 1010 on plain urllib) and
|
|
collects the Stripe checkout action_url.
|
|
|
|
Output: action_urls.txt (JSONL: email, org_id, action_url).
|
|
|
|
ACTIVATION IS MANUAL BY DESIGN. Stripe Radar + invisible hCaptcha block every
|
|
headless/automated browser (Playwright, Camoufox, 2captcha token injection all
|
|
fail). The ONLY working path: open each action_url in YOUR OWN real browser,
|
|
enter YOUR OWN card, click "Start trial". This script never sees/stores/transmits
|
|
card data — it only fetches the checkout URL for you to open manually.
|
|
|
|
Usage: python activate_all.py
|
|
"""
|
|
import json, time
|
|
from playwright.sync_api import sync_playwright
|
|
|
|
BEARER = "Bea" + "rer "
|
|
API = "https://api.vetta.sh/v1"
|
|
VER = "2026-09-30"
|
|
UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
|
|
|
JS = """async (a)=>{
|
|
const H={'content-type':'application/json','authorization':a.b+a.sk,'vetta-version':a.v};
|
|
const sub=await fetch(a.api+'/credits/subscription',{headers:H});
|
|
let sd={};try{sd=await sub.json();}catch(e){}
|
|
if(sd.status && sd.status!=='none'){return {active:true,status:sd.status};}
|
|
const r=await fetch(a.api+'/credits/subscription',{method:'POST',
|
|
headers:Object.assign({'idempotency-key':'sub-'+Date.now()},H),
|
|
body:JSON.stringify({plan:'standard'})});
|
|
let d={};try{d=await r.json();}catch(e){}
|
|
return {active:false,s:r.status,url:d.action_url,days:d.trial_days,credit:d.trial_credit_micro_usd};
|
|
}"""
|
|
|
|
def main():
|
|
accs = [json.loads(l) for l in open("accounts.jsonl") if l.strip()]
|
|
print(f"pool: {len(accs)} accounts")
|
|
out = []
|
|
with sync_playwright() as p:
|
|
br = p.chromium.launch(headless=True, args=["--disable-blink-features=AutomationControlled"])
|
|
pg = br.new_context(user_agent=UA).new_page()
|
|
pg.goto(API + "/auth/session", wait_until="domcontentloaded", timeout=45000)
|
|
time.sleep(1)
|
|
for a in accs:
|
|
try:
|
|
res = pg.evaluate(JS, {"b": BEARER, "sk": a["secret"], "v": VER, "api": API})
|
|
except Exception as e:
|
|
print(f"[ERR] {a.get('email')} {e}")
|
|
continue
|
|
if res.get("active"):
|
|
print(f"[SKIP-ACTIVE] {a['email']} ({res['status']})")
|
|
elif res.get("url"):
|
|
print(f"[URL] {a['email']} trial={res.get('days')}d credit=${(res.get('credit') or 0)/1e6:.0f}")
|
|
out.append({"email": a["email"], "org_id": a.get("org_id"), "action_url": res["url"]})
|
|
else:
|
|
print(f"[ERR] {a['email']} {res}")
|
|
time.sleep(2)
|
|
br.close()
|
|
with open("action_urls.txt", "w") as f:
|
|
for o in out:
|
|
f.write(json.dumps(o) + "\n")
|
|
print(f"\n{len(out)} action_url(s) -> action_urls.txt")
|
|
print("MANUAL ACTIVATION: open each URL in YOUR real browser, enter YOUR card, Start trial.")
|
|
print("Never automate this — hCaptcha/Radar block all headless browsers.")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|