cp.nvim/scrapers/language_ids.py
Barrett Ruth caf4a2e026 feat(codechef): implement login and submit
Problem: CodeChef login and submit were stub-only. Language IDs were
also missing for USACO, Kattis, and CodeChef.

Solution: Add StealthySession browser-based login (checks `__NEXT_DATA__`
for current user, fills email/password form) and submit (navigates to
`/{contest_id}/submit/{problem_id}`, selects language via select element
or custom dropdown fallback, sets code via Monaco/CodeMirror/textarea JS,
clicks submit). Cookie cache at `~/.cache/cp-nvim/codechef-cookies.json`.
Add language IDs for all three new platforms to `language_ids.py`.
2026-03-06 00:05:17 -05:00

30 lines
590 B
Python

LANGUAGE_IDS = {
"atcoder": {
"cpp": "6017",
"python": "6082",
},
"codeforces": {
"cpp": "89",
"python": "70",
},
"cses": {
"cpp": "C++17",
"python": "Python3",
},
"usaco": {
"cpp": "cpp",
"python": "python",
},
"kattis": {
"cpp": "C++17",
"python": "Python 3",
},
"codechef": {
"cpp": "C++ 17",
"python": "Python 3",
},
}
def get_language_id(platform: str, language: str) -> str | None:
return LANGUAGE_IDS.get(platform, {}).get(language)