cp.nvim/scrapers
Barrett Ruth 127089c57f
fix(submit): harden atcoder and codeforces submit flow (#304)
## Problem

AtCoder file upload always wrote a `.cpp` temp file regardless of
language. CF submit used `solve_cloudflare=True` on the submit page,
causing a spurious "No Cloudflare challenge found" error;
`_wait_for_gate_reload` in `login_action` was dead code. Stale cookies
caused silent auth failures with no recovery path. The `uv.spawn` ndjson
path for submit had no overall timeout.

## Solution

Replace AtCoder's temp file with `page.set_input_files` using an
in-memory buffer and correct extension via `_LANGUAGE_ID_EXTENSION`.
Replace CF's temp-file/fallback dance with a direct
`textarea[name="source"]` fill and set `solve_cloudflare=False` on the
submit fetch. Add a login fast-path that skips the homepage check when
cookies exist, with automatic stale-cookie recovery via `_retried` flag
on redirect-to-login detection. Remove `_wait_for_gate_reload`. Fix
`_ensure_browser` to propagate install errors. Add a 120s kill timer to
the ndjson `uv.spawn` submit path in `scraper.lua`.
2026-03-05 11:18:34 -05:00
..
__init__.py lol 2025-09-24 21:23:06 -04:00
atcoder.py fix(submit): harden atcoder and codeforces submit flow (#304) 2026-03-05 11:18:34 -05:00
base.py ci: format 2026-03-03 15:09:41 -05:00
codechef.py feat(codeforces): implement submit; cache CSES token (#300) 2026-03-05 10:37:39 -05:00
codeforces.py fix(submit): harden atcoder and codeforces submit flow (#304) 2026-03-05 11:18:34 -05:00
cses.py feat(codeforces): implement submit; cache CSES token (#300) 2026-03-05 10:37:39 -05:00
kattis.py feat(codeforces): implement submit; cache CSES token (#300) 2026-03-05 10:37:39 -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(scraper): add precision extraction, start_time, and submit support 2026-03-03 15:09:41 -05:00
timeouts.py feat(codeforces): implement submit; cache CSES token (#300) 2026-03-05 10:37:39 -05:00
usaco.py feat(codeforces): implement submit; cache CSES token (#300) 2026-03-05 10:37:39 -05:00