autoreg-skills-max: initial public release (restored, redacted, hardened)
This commit is contained in:
@@ -0,0 +1,115 @@
|
||||
# ChatGPT Headed Browser Registration — Working Techniques (2026-07-30)
|
||||
|
||||
Technical findings from live debugging of Camoufox + Playwright registration flow against OpenAI's signup.
|
||||
|
||||
## Flow Summary
|
||||
|
||||
OpenAI email registration flow: `email submit → OTP → age confirmation → about_you → redirect to chatgpt.com`
|
||||
|
||||
## Working Techniques
|
||||
|
||||
### 1. OTP Input: JS Injection Bypasses React Controlled Inputs
|
||||
|
||||
Playwright `fill()`/`type()` does NOT work on React-controlled input fields — React overwrites the value. Use native value setter + synthetic events:
|
||||
|
||||
```javascript
|
||||
const nativeSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set;
|
||||
nativeSetter.call(input, otpCode);
|
||||
input.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
input.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
```
|
||||
|
||||
**Detection**: Try split-box pattern first (6 separate numeric inputs), then fall back to single input.
|
||||
|
||||
### 2. OTP Submission Detection: `code=` in Page Title
|
||||
|
||||
**CRITICAL BUG FIXED (2026-07-30):** After OTP is accepted, OpenAI redirects via meta-refresh/JS — the URL stays at `auth.openai.com/email-verification` but the page **title** changes to:
|
||||
|
||||
```
|
||||
Loading https://chatgpt.com/api/auth/callback/openai?code=ac...
|
||||
```
|
||||
|
||||
Old detection only checked URL changes and "How old are you?" / "confirm your age" in title — missed the intermediate redirect state. **Fix**: add `"code=" in page_title and "chatgpt.com" in page_title` to the success condition list.
|
||||
|
||||
Fallback after detection: the browser naturally follows the meta-refresh/JS redirect within seconds.
|
||||
|
||||
### 3. Age / about_you Page Detection
|
||||
|
||||
After OTP redirect completes, OpenAI shows age confirmation with these title variants:
|
||||
- `"How old are you? - OpenAI"`
|
||||
- `"Let's confirm your age - OpenAI"`
|
||||
|
||||
Both must be in the detection list. The URL becomes `auth.openai.com/about-you`.
|
||||
|
||||
### 4. about_you Form Fill
|
||||
|
||||
Form has `input[name="name"]` and `input[name="age"]` plus a hidden `input[name="birthday"]`. Fill all three:
|
||||
|
||||
```python
|
||||
await page.fill('input[name="name"]', full_name)
|
||||
await page.fill('input[name="age"]', age_str)
|
||||
await page.evaluate(f"document.querySelector('input[name=\"birthday\"]').value = '{birthdate}'")
|
||||
```
|
||||
|
||||
### 5. about_you Submit: JS Click + Form Submit Fallback
|
||||
|
||||
Playwright `click()` times out on React buttons. Use JS click:
|
||||
|
||||
```javascript
|
||||
const buttons = document.querySelectorAll('button');
|
||||
for (const btn of buttons) {
|
||||
const text = (btn.textContent || '').toLowerCase();
|
||||
if (text.includes('finish creating account') || btn.type === 'submit') {
|
||||
if (btn.offsetParent !== null) { btn.click(); return 'clicked:' + text; }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After click, poll URL for 9 seconds (6×1.5s). If no redirect, try `form.submit()`:
|
||||
```javascript
|
||||
const f = document.querySelector('form'); if(f) f.submit();
|
||||
```
|
||||
|
||||
**Known issue**: OpenAI anti-bot detection may block the redirect after successful form fill + submit. The form fills correctly and the button click fires, but OpenAI's server-side checks reject the submission.
|
||||
|
||||
### 6. Page Wait Strategy
|
||||
|
||||
Use `networkidle` + explicit `wait_for_selector` (NOT `domcontentloaded`):
|
||||
|
||||
```python
|
||||
await page.wait_for_load_state('networkidle', timeout=15000)
|
||||
await page.wait_for_selector('input[inputmode="numeric"], input[autocomplete="one-time-code"]', timeout=10000)
|
||||
```
|
||||
|
||||
## Pitfalls
|
||||
|
||||
### t-online.de Domain Block
|
||||
OpenAI no longer sends verification codes to t-online.de addresses (~80% failure rate as of 2026-07-30). Codes that DO arrive still work for OTP. Use non-German email providers (Gmail, Outlook, Proton).
|
||||
|
||||
### Python .pyc Caching on Live Servers
|
||||
When iterating on code with a running server, Python loads cached `.pyc` files. After any code change:
|
||||
```bash
|
||||
find /path/to/project -name "*.pyc" -delete
|
||||
find /path/to/project -name "__pycache__" -type d -exec rm -rf {} +
|
||||
# Then restart server
|
||||
```
|
||||
Without this, the server continues running old code despite file changes.
|
||||
|
||||
### Camoufox Crash
|
||||
`TypeError: Cannot read properties of undefined (reading '_getChildFrames')` — known Camoufox bug. Retry the task.
|
||||
|
||||
### State Machine OTP Loop
|
||||
If age page ("How old are you?") appears but URL is still `email-verification`, the state machine may loop back to OTP step. The fix is detecting `code=` in title (see technique #2) — this tells the state machine OTP was accepted and redirect is in progress.
|
||||
|
||||
### about_you Button Not Found
|
||||
Even with successful JS click (`clicked:finish creating account`), OpenAI may not redirect — the page stays on about_you. This is server-side anti-bot, not a code bug. Possible mitigations: human-like delays between field fills, cursor movements, or different IP/proxy.
|
||||
|
||||
## Environment
|
||||
|
||||
- **Project**: `C:/Users/User/Desktop/GPT-AUTOREG/aBaiAutoplus/`
|
||||
- **File**: `platforms/chatgpt/browser_register.py`
|
||||
- **DB**: `account_manager.db` (SQLite)
|
||||
- **Email pool**: `C:/Users/User/Desktop/GPT-AUTOREG/emails.txt` (`email:password` format)
|
||||
- **Server**: `cd aBaiAutoplus && python -u main.py` → `http://localhost:8000`
|
||||
- **Registration API**: `POST /api/tasks/register` with `{"executor_type":"headed","captcha_solver":"auto","extra":{"mail_provider":"imap_pool","identity_provider":"mailbox"}}`
|
||||
- **Browser**: Camoufox (Playwright fork) via `[Solver]` subsystem
|
||||
Reference in New Issue
Block a user