cp.nvim/scrapers
Barrett Ruth 543480a4fe
feat: implement login and submit for USACO, Kattis, and CodeChef (#325)
## Problem

Login and submit were stub-only for USACO, Kattis, and CodeChef, leaving
three platforms without a working solve loop.

## Solution

Three commits, one per platform:

**USACO** — httpx-based login via `login-session.php` with cookie cache.
Submit fetches the problem page and parses the form dynamically (action
URL, hidden fields, language select) before POSTing multipart with
`sub_file[]`.

**Kattis** — httpx-based login via `/login/email` (official Kattis CLI
API). Submit is a multipart POST to `/submit`; the `contest` field is
included only when `contest_id != problem_id`. `scrape_contest_list`
URL updated to filter
`kattis_original=on&kattis_recycled=off&user_created=off`.

**CodeChef** — StealthySession browser-based login and submit following
the AtCoder/CF pattern. Login checks `__NEXT_DATA__` for current user
and fills the email/password form. Submit navigates to
`/{contest_id}/submit/{problem_id}`, selects language (standard
`<select>` first, custom dropdown fallback), sets code via
Monaco/CodeMirror/textarea JS, and clicks submit. Retry-on-relogin
pattern matches existing CF behaviour.

Language IDs added to `language_ids.py` for all three platforms.
2026-03-06 00:09:16 -05:00
..
__init__.py lol 2025-09-24 21:23:06 -04:00
atcoder.py feat(commands): implement :CP open [problem|contest|standings] (#319) 2026-03-05 19:16:05 -05:00
base.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
codechef.py feat: implement login and submit for USACO, Kattis, and CodeChef (#325) 2026-03-06 00:09:16 -05:00
codeforces.py feat(commands): implement :CP open [problem|contest|standings] (#319) 2026-03-05 19:16:05 -05:00
cses.py feat(commands): implement :CP open [problem|contest|standings] (#319) 2026-03-05 19:16:05 -05:00
kattis.py feat: implement login and submit for USACO, Kattis, and CodeChef (#325) 2026-03-06 00:09:16 -05:00
language_ids.py feat: implement login and submit for USACO, Kattis, and CodeChef (#325) 2026-03-06 00:09:16 -05:00
models.py feat(commands): implement :CP open [problem|contest|standings] (#319) 2026-03-05 19:16:05 -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: implement login and submit for USACO, Kattis, and CodeChef (#325) 2026-03-06 00:09:16 -05:00