Improve Airbnb browser automation and calendar updates.
Adds browser helper, expands calendar sync, and documents handoff status.
This commit is contained in:
@@ -41,13 +41,46 @@ python -m src.main # full flow (alerts + Airbnb update)
|
||||
| `LOOKAHEAD_DAYS` | No | Days ahead to scan for events (default: 30) |
|
||||
| `LOG_LEVEL` | No | Logging level (default: INFO) |
|
||||
|
||||
## Airbnb session setup (one-time)
|
||||
## Airbnb session setup (one-time / refresh)
|
||||
|
||||
Airbnb requires a logged-in browser session saved to `state.json`. Headless servers cannot complete 2FA — run login on a machine with a display, then copy the file to the server.
|
||||
|
||||
### Local login (Mac)
|
||||
|
||||
```bash
|
||||
python scripts/airbnb_login.py
|
||||
```
|
||||
|
||||
This opens a headed browser. Log in manually, complete any 2FA, then press Enter in the terminal. Your session is saved to `state.json` for reuse in headless runs.
|
||||
Chromium opens. Log in, complete any 2FA, then press Enter in the terminal. Session cookies are saved to `state.json`.
|
||||
|
||||
### Production (automationlab @ 10.0.10.45)
|
||||
|
||||
Recommended: login on your Mac, then copy:
|
||||
|
||||
```bash
|
||||
scp state.json root@10.0.10.45:/opt/atanyrate/state.json
|
||||
ssh root@10.0.10.45 'chmod 600 /opt/atanyrate/state.json'
|
||||
```
|
||||
|
||||
Or use the ansible deploy script: `ATANYRATE_STATE=~/path/to/state.json make deploy-atanyrate` (see `docs/guides/atanyrate-deploy.md` in the ansible repo).
|
||||
|
||||
### Session expiry
|
||||
|
||||
Airbnb sessions expire (weeks to months). When calendar automation fails with login/auth errors or empty calendar pages, re-run `scripts/airbnb_login.py` and push a fresh `state.json`. Weekly cron uses `--alerts-only` by default so Telegram alerts keep working if Airbnb auth is stale.
|
||||
|
||||
### Stealth browser (optional)
|
||||
|
||||
If Airbnb blocks or challenges stock Playwright Chromium, try [invisible_playwright](https://github.com/feder-cr/invisible_playwright) (patched Firefox, anti-detect):
|
||||
|
||||
```bash
|
||||
pip install 'git+https://github.com/feder-cr/invisible_playwright.git'
|
||||
python -m invisible_playwright fetch # ~100 MB one-time
|
||||
|
||||
AIRBNB_STEALTH=1 python scripts/airbnb_login.py # login + save state.json
|
||||
AIRBNB_STEALTH=1 python -m src.main # headless calendar run
|
||||
```
|
||||
|
||||
Use **the same engine** for login and automation — `state.json` from Chromium does not work in Firefox and vice versa. Stealth mode does **not** bypass 2FA; you still log in manually in the headed window.
|
||||
|
||||
## Running on cron
|
||||
|
||||
@@ -63,6 +96,15 @@ docker build -t eventrate .
|
||||
docker run --rm --env-file .env -v $(pwd)/state.json:/app/state.json eventrate
|
||||
```
|
||||
|
||||
## Production deploy
|
||||
|
||||
Deployed on **automationlab** (`10.0.10.45`) at `/opt/atanyrate`. Full guide: ansible repo `docs/guides/atanyrate-deploy.md`.
|
||||
|
||||
```bash
|
||||
# From ~/Documents/code/ansible
|
||||
ATANYRATE_ENV=~/Documents/code/@AnyRate/.env make deploy-atanyrate
|
||||
```
|
||||
|
||||
## Project docs
|
||||
|
||||
- [PROJECT.md](PROJECT.md) — goals, scope, constraints
|
||||
|
||||
Reference in New Issue
Block a user