126 lines
4.9 KiB
Python
Executable File
126 lines
4.9 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Baaaai.com Auto-Registration + Balance Application (Playwright version)
|
|
Регает акки через браузер и подаёт заявку на $50/$80 баланса.
|
|
Запуск: python -u baaaai_autoreg.py [кол-во акков] [начальный индекс]
|
|
"""
|
|
import sys, json, random, string, time, os
|
|
from pathlib import Path
|
|
from playwright.sync_api import sync_playwright
|
|
|
|
BASE_URL = "https://baaaai.com"
|
|
ACCOUNTS_FILE = Path.home() / "Desktop" / "baaaai_accounts.json"
|
|
EMAILS_FILE = Path.home() / "Downloads" / "Telegram Desktop" / "working_mails.txt"
|
|
COUNT = int(sys.argv[1]) if len(sys.argv) > 1 else 1
|
|
START_IDX = int(sys.argv[2]) if len(sys.argv) > 2 else 0
|
|
BALANCE_AMOUNT = 50
|
|
BALANCE_REASON = "gpt 5.6 luna terra sol"
|
|
|
|
def load_emails():
|
|
emails = []
|
|
with open(EMAILS_FILE, "r", encoding="utf-8") as f:
|
|
for line in f:
|
|
line = line.strip()
|
|
if ":" in line:
|
|
email, password = [REDACTED]":", 1)
|
|
emails.append((email.strip(), password.strip()))
|
|
return emails
|
|
|
|
def generate_password():
|
|
chars = string.ascii_letters + string.digits + "!@#$%^&*"
|
|
return "".join(random.choices(chars, k=random.randint(14, 18)))
|
|
|
|
def save_account(account):
|
|
accounts = []
|
|
if ACCOUNTS_FILE.exists():
|
|
try:
|
|
with open(ACCOUNTS_FILE, "r", encoding="utf-8") as f:
|
|
accounts = json.load(f)
|
|
except: pass
|
|
accounts.append(account)
|
|
with open(ACCOUNTS_FILE, "w", encoding="utf-8") as f:
|
|
json.dump(accounts, f, indent=2, ensure_ascii=False)
|
|
print(f" Saved ({len(accounts)} total)")
|
|
|
|
def main():
|
|
print(f"Baaaai Auto-Reg v1.0 | {COUNT} accounts | ${BALANCE_AMOUNT} balance")
|
|
emails = load_emails()
|
|
print(f"Email pool: {len(emails)}")
|
|
|
|
pw = sync_playwright().start()
|
|
temp_profile = Path.home() / "AppData" / "Local" / "Temp" / "chrome-baaaai-reg"
|
|
|
|
browser = pw.chromium.launch_persistent_context(
|
|
user_data_dir=str(temp_profile), headless=False, channel="chrome",
|
|
args=["--no-sandbox", "--disable-blink-features=AutomationControlled"],
|
|
viewport={"width": 1280, "height": 800}
|
|
)
|
|
page = browser.new_page()
|
|
success = 0
|
|
|
|
for i in range(START_IDX, START_IDX + COUNT):
|
|
if i >= len(emails): break
|
|
email, _ = emails[i]
|
|
pwd = [REDACTED])
|
|
print(f"\n--- {i+1}/{START_IDX+COUNT}: {email} ---")
|
|
|
|
page.goto(f"{BASE_URL}/register", wait_until="domcontentloaded", timeout=30000)
|
|
time.sleep(2)
|
|
|
|
# Wait for Turnstile
|
|
solved = False
|
|
for attempt in range(15):
|
|
time.sleep(1)
|
|
try:
|
|
if page.locator("#email").is_enabled():
|
|
solved = True
|
|
print(f" Turnstile solved after {attempt+1}s")
|
|
break
|
|
except: pass
|
|
|
|
if not solved:
|
|
print(" Turnstile timeout")
|
|
continue
|
|
|
|
page.locator("#email").fill(email)
|
|
page.locator("#password").fill(pwd)
|
|
try: page.locator("#login-agreement-consent").check()
|
|
except: pass
|
|
page.locator("button[type=submit]").click()
|
|
time.sleep(3)
|
|
|
|
print(f" URL: {page.url}")
|
|
if "dashboard" in page.url.lower():
|
|
token = [REDACTED]"localStorage.getItem('auth_token')")
|
|
api_key = None
|
|
try:
|
|
page.goto(f"{BASE_URL}/keys", wait_until="domcontentloaded", timeout=15000)
|
|
time.sleep(2)
|
|
page.locator("button:has-text('Create')").first.click()
|
|
time.sleep(1)
|
|
page.locator("input[name=name]").first.fill(f"gb-{random.randint(1000,9999)}")
|
|
page.locator("button:has-text('Create')").last.click()
|
|
time.sleep(2)
|
|
api_key = [REDACTED]"(document.body.innerText.match(/sk-[a-f0-9]{40,}/i) || [null])[0]")
|
|
print(f" API Key: {api_key[:30] if api_key else 'FAIL'}...")
|
|
except Exception as e:
|
|
print(f" Key error: {e}")
|
|
|
|
# Apply balance
|
|
if token:
|
|
[REDACTED] = page.evaluate(f"""
|
|
(async()=>{{const r=await fetch('/user/balance-applications',{{method:'POST',headers:{{'Content-Type':'application/json','Authorization':'Bearer {token}'}},body:JSON.stringify({{amount:{BALANCE_AMOUNT},reason:'{BALANCE_REASON}'}})}});return JSON.stringify({{status:r.status,body:await r.text()}});}})()
|
|
""")
|
|
print(f" Balance: {result[:200]}")
|
|
|
|
save_account({"email":email,"password":pwd,"api_key":api_key,"token":token,"registered_at":time.strftime("%Y-%m-%d %H:%M:%S"),"balance_applied":BALANCE_AMOUNT})
|
|
success += 1
|
|
|
|
time.sleep(2)
|
|
|
|
browser.close()
|
|
pw.stop()
|
|
print(f"\nDone: {success}/{COUNT}")
|
|
|
|
if __name__ == "__main__":
|
|
main() |