Files
vetta-toolkit/check_pool.py
T
gothbreach f049a2636d vetta: cross-platform (Windows+Linux) CLI + full guide + BIN/test-card tool
- vetta.py: unified cross-platform CLI dispatcher (register/activate/check/gateway/bin), resolves scripts relative to itself, relaunches via sys.executable (venv-safe)
- run.sh (LF, robust interpreter probe skips broken python3 stubs) + run.bat (CRLF) OS launchers
- .gitattributes: LF for .sh/.py/.md, CRLF for .bat -> run.sh never breaks on Linux, run.bat never breaks on Windows
- bin/cc_gen.py: Luhn-valid test-card generator (Visa/MC/Amex/Discover), stdlib, cross-platform, CLI + JSON
- bin/BINS.md: honest card/BIN reference - real VCCs (kliencard/privacy/Revolut/Wise) that pass Stripe pre-auth vs generated cards that do NOT
- GUIDE.md: full Windows + Linux + macOS setup, quickstart, gateway usage, env config, cross-platform notes, troubleshooting
- encoding fix: activate_all.py + check_pool.py open() now explicit utf-8 (Windows cp1251 default corrupted non-ASCII emails/orgs)
- README: cross-platform quickstart, guide/BIN links, updated file table
- .gitignore: ignore generated card output + Windows pymanager junk
2026-10-14 11:49:24 +03:00

55 lines
2.5 KiB
Python

"""Check pool account status: balance, subscription, model access.
Reads accounts.jsonl (gitignored — your local pool). For each account, queries
/credits/balance + /credits/subscription via a real browser context (same-origin
fetch avoids Cloudflare 1010). Reports ACTIVE (trial/subscription live, models
reachable) vs DEAD (no card -> balance $0, subscription 'none', models/proxy 402).
Usage: python check_pool.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 g=async(u)=>{const r=await fetch(u,{headers:H});return {s:r.status,b:await r.text()};};
const bal=await g(a.api+'/credits/balance');
const sub=await g(a.api+'/credits/subscription');
let b={},s={};try{b=JSON.parse(bal.b);}catch(e){}try{s=JSON.parse(sub.b);}catch(e){}
return {balance:b.balance_micro_usd,sub_status:s.status,plan:s.plan,period_end:s.current_period_end};
}"""
def main():
accs = [json.loads(l) for l in open("accounts.jsonl", encoding="utf-8") if l.strip()]
print(f"pool: {len(accs)} accounts")
active, dead = [], []
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
is_active = res.get("sub_status") == "active"
bal = (res.get("balance") or 0) / 1e6
tag = "ACTIVE" if is_active else "DEAD "
print(f"[{tag}] {a['email']:<40} ${bal:.2f} sub={res.get('sub_status')} plan={res.get('plan')} end={res.get('period_end')}")
(active if is_active else dead).append(a["email"])
time.sleep(1.5)
br.close()
print(f"\nACTIVE: {len(active)} | DEAD (no card / 402): {len(dead)}")
if dead:
print("DEAD accounts need manual trial activation (card) — see activate_all.py")
if __name__ == "__main__":
main()