fix(scrapers): cookie fast paths, centralized storage, and reauth hardening #363

Merged
barrettruth merged 6 commits from fix/scraper-browser-v2 into main 2026-03-07 21:10:51 +00:00
barrettruth commented 2026-03-07 20:35:31 +00:00

Problem

Scraper cookie handling was fragmented across per-platform files with no
shared access, httpx scrapers lacked checking_login fast paths on
login, and several re-auth edge cases (CodeChef submit, CF cookie guard,
AtCoder cookie persistence) caused unnecessary full re-logins or silent
failures.

Solution

Centralize all cookie storage into a single cookies.json via helpers
in base.py. Add checking_login fast paths to kattis.py (using the
x-username response header as a session probe), usaco.py, and
cses.py login flows. Fix kattis.py submit to emit checking_login
only after loading cookies. Remove AtCoder cookie persistence from login
entirely — always do a fresh session. Harden CodeChef and CF reauth
with consistent status logging and cookie guard checks.

## Problem Scraper cookie handling was fragmented across per-platform files with no shared access, httpx scrapers lacked `checking_login` fast paths on login, and several re-auth edge cases (CodeChef submit, CF cookie guard, AtCoder cookie persistence) caused unnecessary full re-logins or silent failures. ## Solution Centralize all cookie storage into a single `cookies.json` via helpers in `base.py`. Add `checking_login` fast paths to `kattis.py` (using the `x-username` response header as a session probe), `usaco.py`, and `cses.py` login flows. Fix `kattis.py` submit to emit `checking_login` only after loading cookies. Remove AtCoder cookie persistence from login entirely — always do a fresh session. Harden CodeChef and CF reauth with consistent status logging and cookie guard checks.
Sign in to join this conversation.
No description provided.