## Problem `_submit_sync` was a 170-line nested closure with `_solve_turnstile` and the browser-install block further nested inside it. Status events went to stderr, which `run_scraper()` silently discards, leaving the user with a 10–30s silent hang after credential entry. The NDJSON spawn path also lacked stdin support, so submit had no streaming path at all. ## Solution Extract `_TURNSTILE_JS`, `_solve_turnstile`, `_ensure_browser`, and `_submit_headless` to module level in `atcoder.py`; status events (`installing_browser`, `checking_login`, `logging_in`, `submitting`) now print to stdout as NDJSON. Add stdin pipe support to the NDJSON spawn path in `scraper.lua` and switch `M.submit` to streaming with an `on_status` callback. Wire `on_status` in `submit.lua` to fire `vim.notify` for each phase transition.
18 lines
361 B
Python
18 lines
361 B
Python
LANGUAGE_IDS = {
|
|
"atcoder": {
|
|
"cpp": "6017",
|
|
"python": "6082",
|
|
},
|
|
"codeforces": {
|
|
"cpp": "89",
|
|
"python": "70",
|
|
},
|
|
"cses": {
|
|
"cpp": "C++17",
|
|
"python": "Python3",
|
|
},
|
|
}
|
|
|
|
|
|
def get_language_id(platform: str, language: str) -> str | None:
|
|
return LANGUAGE_IDS.get(platform, {}).get(language)
|