autoreg-skills-max: initial public release (restored, redacted, hardened)
This commit is contained in:
149
skills/github-autoreg/templates/reg_mailtm.py
Normal file
149
skills/github-autoreg/templates/reg_mailtm.py
Normal file
@@ -0,0 +1,149 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
GitHub AutoReg — mail.tm version (temporary emails, no email list needed)
|
||||
|
||||
ИСПОЛЬЗОВАНИЕ:
|
||||
python reg_mailtm.py # 10 аккаунтов
|
||||
python reg_mailtm.py --count 50 # 50 аккаунтов
|
||||
"""
|
||||
|
||||
import asyncio, random, string, time, traceback, sys
|
||||
from pathlib import Path
|
||||
from argparse import ArgumentParser
|
||||
|
||||
# Add src to path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
from src.mailtm_utils import create_email, wait_for_code
|
||||
from src.browser_utils import (
|
||||
create_context, fill_signup_form, dismiss_flash_alerts,
|
||||
click_create_account, fill_verification_code, is_success_url,
|
||||
GITHUB_SIGNUP,
|
||||
)
|
||||
|
||||
OUTPUT_FILE = Path("accounts.txt")
|
||||
MAX_ACCOUNTS = 10
|
||||
DELAY_MIN, DELAY_MAX = 120, 300
|
||||
|
||||
|
||||
def gen_password(length: int = 16) -> str:
|
||||
chars = string.ascii_letters + string.digits + "!@#$%^&*"
|
||||
return ''.join(random.choice(chars) for _ in range(length))
|
||||
|
||||
|
||||
def gen_username() -> str:
|
||||
prefixes = ["dev", "code", "web", "pro", "neo", "zen", "hex", "vox",
|
||||
"byte", "core", "edge", "node", "peak", "nova", "echo", "sigma"]
|
||||
return f"{random.choice(prefixes)}{random.randint(100, 9999)}"
|
||||
|
||||
|
||||
async def register_one() -> dict | None:
|
||||
"""Регистрация одного GitHub аккаунта через mail.tm"""
|
||||
# 1. Создаём временную почту
|
||||
print(" [*] Creating temp email...")
|
||||
mail = create_email()
|
||||
print(f" [*] Email: {mail['email']}")
|
||||
|
||||
username = gen_username()
|
||||
gh_password = gen_password()
|
||||
|
||||
from playwright.async_api import async_playwright
|
||||
p = await async_playwright().start()
|
||||
|
||||
try:
|
||||
ctx = await create_context(p)
|
||||
page = await ctx.new_page()
|
||||
|
||||
# 2. Загружаем signup
|
||||
await page.goto(GITHUB_SIGNUP, wait_until="networkidle", timeout=30000)
|
||||
await page.wait_for_timeout(3000)
|
||||
await dismiss_flash_alerts(page)
|
||||
|
||||
# 3. Заполняем форму
|
||||
print(f" [*] Username: {username}")
|
||||
await fill_signup_form(page, mail["email"], gh_password, username)
|
||||
|
||||
# 4. Submit
|
||||
print(" [*] Submit...")
|
||||
await click_create_account(page)
|
||||
await page.wait_for_timeout(5000)
|
||||
url = page.url
|
||||
|
||||
# 5. Ждём код
|
||||
if "account_verifications" in url or "verify" in url.lower():
|
||||
print(" [*] Waiting for code...")
|
||||
code = wait_for_code(mail["token"], timeout=120)
|
||||
|
||||
if not code:
|
||||
print(" [!] No code received")
|
||||
await page.screenshot(path=f"fail_{username}.png")
|
||||
return None
|
||||
|
||||
print(f" [*] Code: {code}")
|
||||
await fill_verification_code(page, code)
|
||||
await page.wait_for_timeout(3000)
|
||||
url = page.url
|
||||
|
||||
# 6. Проверяем
|
||||
if is_success_url(url):
|
||||
print(f" [OK] {username}")
|
||||
return {
|
||||
"email": mail["email"],
|
||||
"email_password": mail["password"],
|
||||
"username": username,
|
||||
"github_password": gh_password,
|
||||
"time": time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
}
|
||||
else:
|
||||
body = await page.evaluate("() => document.body.innerText[:300]")
|
||||
print(f" [X] Failed: {url[:100]} | {body[:100]}")
|
||||
await page.screenshot(path=f"fail_{username}.png")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f" [X] {e}")
|
||||
traceback.print_exc()
|
||||
return None
|
||||
finally:
|
||||
await ctx.close()
|
||||
await p.stop()
|
||||
|
||||
|
||||
async def main():
|
||||
parser = ArgumentParser(description="GitHub AutoReg — mail.tm version")
|
||||
parser.add_argument("--count", type=int, default=MAX_ACCOUNTS, help="Accounts to create")
|
||||
parser.add_argument("--delay-min", type=int, default=DELAY_MIN)
|
||||
parser.add_argument("--delay-max", type=int, default=DELAY_MAX)
|
||||
args = parser.parse_args()
|
||||
|
||||
print("=" * 60)
|
||||
print("GitHub AutoReg — mail.tm")
|
||||
print(f" Count: {args.count}")
|
||||
print(f" Delay: {args.delay_min}-{args.delay_max}s")
|
||||
print("=" * 60)
|
||||
|
||||
ok = 0
|
||||
for i in range(args.count):
|
||||
print(f"\n--- {i+1}/{args.count} ---")
|
||||
result = await register_one()
|
||||
|
||||
if result:
|
||||
ok += 1
|
||||
with open(OUTPUT_FILE, 'a', encoding='utf-8') as f:
|
||||
f.write(f"{result['email']}|{result['email_password']}|"
|
||||
f"{result['username']}|{result['github_password']}\n")
|
||||
print(f" [OK] Total: {ok}")
|
||||
|
||||
if i < args.count - 1:
|
||||
delay = random.uniform(args.delay_min, args.delay_max)
|
||||
print(f" [*] Wait {delay:.0f}s...")
|
||||
time.sleep(delay)
|
||||
|
||||
print(f"\n{'=' * 60}")
|
||||
print(f"Done! Created: {ok}/{args.count}")
|
||||
print(f"Accounts: {OUTPUT_FILE.absolute()}")
|
||||
print(f"{'=' * 60}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user