cp.nvim/scrapers
Barrett Ruth b959f29bd4
fix(scrapers): harden CSES and CF submit edge cases (#295) (#318)
## Problem

CSES `_web_login` used bare dict indexing on the API response, raising
an opaque `KeyError` on missing fields. `_check_token` swallowed all
exceptions as `False`, conflating transient network errors with invalid
tokens. CF persisted cookies unconditionally and silently swallowed
`_solve_turnstile` failures in `submit_action`.

## Solution

CSES API fields now use `.get()` with a descriptive `RuntimeError` on
absence. `_check_token` re-raises `httpx` network/timeout exceptions
so callers see real failures. CF cookie writes are guarded by an
`X-User-Handle` check (the CF auth cookie). `_solve_turnstile` errors
propagate to the outer error handler instead of being silenced.
2026-03-05 19:00:35 -05:00
..
__init__.py lol 2025-09-24 21:23:06 -04:00
atcoder.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
base.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
codechef.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
codeforces.py fix(scrapers): harden CSES and CF submit edge cases (#295) (#318) 2026-03-05 19:00:35 -05:00
cses.py fix(scrapers): harden CSES and CF submit edge cases (#295) (#318) 2026-03-05 19:00:35 -05:00
kattis.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
language_ids.py feat(atcoder): extract submit helpers; add live status notifications (#294) 2026-03-04 19:27:29 -05:00
models.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
timeouts.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
usaco.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00