crowllm.com autoreg: Google OAuth flow, Turnstile, httpOnly refresh-cookie key extraction
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
# crowllm-autoreg
|
||||
|
||||
Browser-driven account registration for **crowllm.com** — an OpenAI-compatible aggregator (new-api fork) that exposes **76 `:free` models** and grants **50 000 000 free-model tokens** on signup, no card.
|
||||
|
||||
Signup is **Google OAuth only** — the email/password form does not exist (`/login` → 404 page). Both Cloudflare Turnstile and a mandatory consent checkbox sit in front of the OAuth button, so a plain HTTP replay is dead (`curl` on `/sign-up` → 403). This repo drives a real headful Chrome instead.
|
||||
|
||||
## What you get per account
|
||||
|
||||
| field | value |
|
||||
|---|---|
|
||||
| `quota` | 5 000 000 |
|
||||
| `earned_quota` | 50 000 000 |
|
||||
| `used_quota` | counts tokens spent (9 units for an 8-token request) |
|
||||
| plan | `free` — free catalogue only |
|
||||
|
||||
`quota` unit ≈ 1 token, so "**$100 credit**" advertised by the site = 50M free-model tokens, not wallet cash. Rate limit: 12 parallel chats → 5×200, 7×429; keep ≤5 concurrent.
|
||||
|
||||
## Free catalogue (sample from a live `GET /v1/models`)
|
||||
|
||||
```
|
||||
gemini-3.1-pro:free gemini-3.8-flash:free gemini-2.5-pro:free
|
||||
deepseek-v4.1-flash:free deepseek-v4-flash:free deepseek-v4.1-flash-uncensored:free
|
||||
kimi-k3 (runpod/) llama-3.3-70b:free minimax-m3.1-flash:free
|
||||
nemotron-3-ultra-550b-a55b:free crow-limitless:free
|
||||
crow-uncensored:free qwen-3.8-max:free qwen-3.8-27b-uncensored:free
|
||||
```
|
||||
|
||||
Verified live: `gemini-3.1-pro:free`, `gemini-3.8-flash:free`, `deepseek-v4.1-flash:free`, `crow-limitless:free`, `qwen-3.8-max:free` → HTTP 200, content in ~1.2 s.
|
||||
|
||||
## Requirements
|
||||
|
||||
```
|
||||
Python 3.11
|
||||
playwright (pip install -r requirements.txt)
|
||||
Google Chrome installed (playwright's bundled chromium is NOT used)
|
||||
accounts with a Google login (any domain that has Google OAuth — Google Workspace / Edu lots work)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
export CROWL_BANK=/path/to/accounts.jsonl # {"email": "...", "password": "..."} per line
|
||||
export CROWL_OUT=/path/to/keys.jsonl # created: {email,password,uid,quota,earned,key,...}
|
||||
export CROWL_FAIL=/path/to/fail.jsonl
|
||||
export CROWL_PROFILE=/path/to/chrome-profile-1 # one profile per worker
|
||||
export CROWL_DOMAINS=example.com # optional comma-separated filter
|
||||
export CROWL_CHROME="C:/Program Files/Google/Chrome/Application/chrome.exe"
|
||||
|
||||
python crowllm_reg.py 1
|
||||
```
|
||||
|
||||
Parallel wave = one process per index with its own `CROWL_PROFILE`:
|
||||
|
||||
```bash
|
||||
for i in 1 2 3 4; do
|
||||
CROWL_PROFILE=/tmp/crowl-prof-$i python crowllm_reg.py $i &
|
||||
done
|
||||
```
|
||||
|
||||
## Flow (what the script actually does)
|
||||
|
||||
1. `GET /sign-up?aff=<aff>` in headful Chrome; wait for `span[role=checkbox][data-slot=checkbox]`.
|
||||
2. Poll `input[name=cf-turnstile-response]` until `len > 50` — Turnstile solves itself in headful Chrome in 5-20 s.
|
||||
3. Click the consent checkbox.
|
||||
4. **Click the Google button with a real mouse event** (`page.mouse.move` then `page.mouse.click` at the button centre). JS `element.click()` and `locator.click(force=True)` fire **no network request at all** — the OAuth popup is gated on user activation.
|
||||
5. Google: `input[name=identifier]` → `#identifierNext button` → `input[name=Passwd]` (a hidden `hiddenPassword` field breaks generic `input[type=password]`) → `#passwordNext button`.
|
||||
6. Consent screen (`Sign in to crowllm.com / You'll share this info`): click Continue (text match `continue` / `allow`, fallback = 85% of the `Cancel\nContinue` container width).
|
||||
7. Landing `/onboarding` = account created. Landing `/sign-in` = OAuth produced no session → logged to the fail file.
|
||||
8. Key extraction: the session lives in the **httpOnly cookie `new_api_refresh`**, not in `localStorage`. `POST /api/user/auth/refresh` → `data.access_token` (396 chars) → use it as `Authorization: Bearer` for `/api/user/self`, `POST /api/token/`, `GET /api/token/?p=1&size=10`, `POST /api/token/{id}/key`.
|
||||
9. The key endpoint answers `{"data":{"key":"..."}}`. The script stores only the `.key` string (48 alnum chars).
|
||||
|
||||
## Verify a key
|
||||
|
||||
```bash
|
||||
curl -s -H "Authorization: Bearer $KEY" https://crowllm.com/v1/models | head -c 200
|
||||
curl -s -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
|
||||
-d '{"model":"gemini-3.8-flash:free","messages":[{"role":"user","content":"Reply with exactly: PONG"}],"max_tokens":20}' \
|
||||
https://crowllm.com/v1/chat/completions
|
||||
```
|
||||
|
||||
## Pitfalls hit while building this
|
||||
|
||||
- OAuth button needs the mouse event (see step 4) — this is the single biggest time sink.
|
||||
- `401 AUTH_UNAUTHORIZED, invalid access token` on `/api/user/self` only means the Bearer token is missing; the refresh cookie is still valid.
|
||||
- Turnstile needs a warm profile: a brand-new profile often returns `cf-turnstile-response` empty for 90 s, while a profile that already passed the challenge solves it in ~5 s.
|
||||
- Success rate in our runs ≈ 57% — failures are `/sign-in` landings and unsolved Turnstile.
|
||||
- Chrome profiles grow ~20 MB each; prune `Cache/`, `Code Cache/`, `GPUCache/`, `Crashpad/` between waves.
|
||||
|
||||
## Legal
|
||||
|
||||
For research on your own accounts. The service's ToS apply; multi-accounting may get accounts revoked.
|
||||
Reference in New Issue
Block a user