first commit
This commit is contained in:
@@ -0,0 +1,186 @@
|
||||
# 9router-Antigravity Auto Add Bot
|
||||
|
||||
Bot otomatis untuk menambahkan akun GSuite ke **9router-Antigravity** via Google OAuth.
|
||||
Bot Harus Jalan di Host yang sama dengan 9router
|
||||
|
||||
## Stack
|
||||
|
||||
- **CloakBrowser** — Stealth Chromium (anti bot detection, bypass Google CAPTCHA)
|
||||
- **Playwright API** compatible
|
||||
- **Node.js** ESM
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
cd gsuite-auto
|
||||
npm install
|
||||
```
|
||||
|
||||
Pastikan CloakBrowser binary sudah ter-download. Kalau download otomatis gagal (network/firewall), manual:
|
||||
|
||||
1. Download dari https://github.com/CloakHQ/cloakbrowser/releases
|
||||
2. Extract ke `~/.cloakbrowser/chromium-<version>/`
|
||||
- Windows: `C:\Users\<username>\.cloakbrowser\chromium-<version>\`
|
||||
|
||||
## Config
|
||||
|
||||
### `config.json`
|
||||
|
||||
```json
|
||||
{
|
||||
"nineRouter": {
|
||||
"url": "http://localhost:20128",
|
||||
"password": "123456"
|
||||
},
|
||||
"accountsFile": "accounts.txt",
|
||||
"settings": {
|
||||
"headless": true,
|
||||
"slowMo": 300,
|
||||
"timeout": 60000,
|
||||
"delayBetweenAccounts": 5000
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Key | Description |
|
||||
|-----|-------------|
|
||||
| `nineRouter.url` | URL 9router instance |
|
||||
| `nineRouter.password` | Login password 9router |
|
||||
| `accountsFile` | File list akun (default: `accounts.txt`) |
|
||||
| `headless` | `true` = tanpa browser window, `false` = visible |
|
||||
| `slowMo` | Delay antar action (ms) |
|
||||
| `timeout` | Max tunggu per step (ms) |
|
||||
| `delayBetweenAccounts` | Delay antar akun (ms) |
|
||||
|
||||
### `accounts.txt`
|
||||
|
||||
Format: `email|password` per baris
|
||||
|
||||
```
|
||||
[email protected]|password123
|
||||
[email protected]|password456
|
||||
# comment bisa pakai #
|
||||
baris kosong di-skip
|
||||
```
|
||||
|
||||
Support multiple file untuk batch berbeda:
|
||||
```
|
||||
accounts-batch1.txt
|
||||
accounts-batch2.txt
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
# Normal run (headless dari config.json)
|
||||
node bot.js
|
||||
|
||||
# Force headless via CLI
|
||||
node bot.js --headless
|
||||
|
||||
# Force visible browser
|
||||
node bot.js --no-headless
|
||||
|
||||
# Dry run (test tanpa eksekusi)
|
||||
node bot.js --dry-run
|
||||
|
||||
# Pakai file accounts lain
|
||||
node bot.js --file accounts-batch2.txt
|
||||
```
|
||||
|
||||
## Flow
|
||||
|
||||
```
|
||||
Untuk SETIAP akun (fresh browser context):
|
||||
│
|
||||
├─ 1. Buka browser baru (clean session, ga ada cookie Google lama)
|
||||
├─ 2. Login 9router
|
||||
├─ 3. Navigate → Providers → Antigravity
|
||||
├─ 4. Click "Add"
|
||||
├─ 5. Click "I Understand, Continue" → buka popup Google OAuth
|
||||
├─ 6. Force hl=en di URL Google (paksa English UI)
|
||||
├─ 7. Input email → click Next
|
||||
│ (multi-bahasa: EN/ID/JA/KO/ZH/FR/ES/DE/RU)
|
||||
├─ 8. Input password → Enter
|
||||
│ (multi-bahasa: EN/ID/JA/KO/ZH/FR/ES/DE/RU)
|
||||
├─ 9. Verify "I understand" (Workspace Terms)
|
||||
│ → click kalau ada, skip kalau ga ada
|
||||
├─ 10. Wait consent page → click Sign in/Continue/Allow
|
||||
│ (multi-bahasa: EN/ID/JA/KO/ZH/FR/ES/DE/RU)
|
||||
├─ 11. Verify email muncul di Antigravity page
|
||||
│ (max 3x refresh)
|
||||
├─ 12. Close browser context
|
||||
└─ 13. Next akun (fresh context lagi)
|
||||
```
|
||||
|
||||
## Multi-Language Support
|
||||
|
||||
Google kadang render UI sesuai bahasa akun, bukan bahasa browser. Bot handle semua variasi:
|
||||
|
||||
| Element | Bahasa |
|
||||
|---------|--------|
|
||||
| Email input | Email or phone,Alamat email atau nomor telepon,メールアドレスまたは電話番号,이메일 또는 전화번호,电子邮件或电话号码,... |
|
||||
| Next button | Next,Berikutnya,Lanjut,次へ,다음,下一步,Suivant,Siguiente,Weiter,Далее |
|
||||
| Password | Enter your password,Masukkan kata sandi Anda,パスワードを入力,비밀번호 입력,输入密码,... |
|
||||
| Terms | I understand,Saya mengerti,理解しました,이해했습니다,我明白了,... |
|
||||
| Consent | Sign in,Masuk,ログイン,登录,Se connecter,Iniciar sesión,Anmelden,Войти,... |
|
||||
|
||||
Log output nunjukin match yang mana:
|
||||
```
|
||||
[>] Email → "Alamat email atau nomor telepon"
|
||||
[>] Next → "Berikutnya"
|
||||
[>] OAuth Consent → "Masuk"
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
| File | Description |
|
||||
|------|-------------|
|
||||
| `accounts.txt` | Auto-update — akun yang berhasil dihapus, sisa yang belum |
|
||||
| `log-YYYY-MM-DD.json` | Hasil detail per akun (success/fail/error) |
|
||||
| `screenshots/` | Screenshot otomatis kalau error |
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
9router-autobot/
|
||||
├── bot.js # Main bot script
|
||||
├── config.json # Config (URL, password, settings)
|
||||
├── accounts.txt # List akun (email|password)
|
||||
├── package.json
|
||||
├── README.md
|
||||
├── recorded-actions.js # Raw Playwright codegen recording (reference)
|
||||
├── record.js # Playwright codegen launcher (untuk re-record)
|
||||
└── screenshots/ # Error screenshots (auto-generated)
|
||||
```
|
||||
|
||||
## Fitur
|
||||
|
||||
- **Fresh context per akun** — session Google ga nyangkut antar akun
|
||||
- **CloakBrowser stealth** — bypass bot detection Google
|
||||
- **Multi-language** — handle UI Google dalam bahasa apapun
|
||||
- **Auto-remove** — akun yang berhasil dihapus dari `accounts.txt`
|
||||
- **Auto-retry verify** — refresh max 3x kalau email belum muncul
|
||||
- **Error screenshot** — auto-capture kalau gagal
|
||||
- **Log harian** — `log-YYYY-MM-DD.json` per run
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
| Masalah | Solusi |
|
||||
|---------|--------|
|
||||
| `CLOAKBROWSER_BINARY_PATH` error | Download manual binary ke `~/.cloakbrowser/` |
|
||||
| Download binary gagal (network) | Download via browser, extract manual ke `~/.cloakbrowser/chromium-<version>/` |
|
||||
| Google CAPTCHA di headless | Pastikan pakai CloakBrowser (bukan Playwright biasa) |
|
||||
| UI Google bahasa lokal | Normal — bot handle multi-bahasa otomatis |
|
||||
| Email ga verify di page | Bot auto-refresh 3x. Kalau tetap gagal, cek manual |
|
||||
| `Failed to assign a backend` | Akun sudah ada di 9router atau quota habis |
|
||||
| Akun 1 berhasil, akun 2 gagal | Normal kalau Terms baru pertama kali — jalankan lagi |
|
||||
| Popup consent ga ke-click | Cek log, kemungkinan bahasa belum ter-cover |
|
||||
|
||||
## Tips
|
||||
|
||||
- **Test dulu** dengan `node bot.js --dry-run` sebelum run beneran
|
||||
- **1 akun dulu** — pastikan flow-nya benar sebelum batch
|
||||
- **Crash-safe** — bot update `accounts.txt` per akun, jadi restart lanjut dari yang belum selesai
|
||||
- **Headless** lebih cepat tapi kadang beda behavior — test visible dulu
|
||||
- **Delay** — kalau sering gagal, naikkan `delayBetweenAccounts` di config
|
||||
Reference in New Issue
Block a user