refactor(console): route interactive prompts through a themed helper

Adds prompt_user() and uses it for local, remote, and Proton VPN input. Replaces click.prompt on the remote auth path, which ignored the theme and overlapped active Live displays. Remote auth now exits on EOF instead of POSTing an empty answer and spinning the poll loop.
This commit is contained in:
imSp4rky
2026-08-15 18:13:05 -06:00
parent a6cb0231d5
commit db4f0b39f9
6 changed files with 30 additions and 14 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ use `self.request_input(prompt)`, never a bare `input()`. Under `serve` mode
there is no local terminal, so a bare `input()` would hang the server waiting on
stdin that never arrives; `request_input` instead relays the prompt to the
remote client through the attached `InputBridge`. Locally it routes through the
shared Rich console (`console.input`) so the prompt renders correctly alongside
shared Rich console (`prompt_user`) so the prompt renders correctly alongside
progress and log output.
!!! warning "Key token caches by whatever varies per session"
+2 -1
View File
@@ -398,7 +398,8 @@ session API and a good template for any client.
- **Retries.** The download-side HTTP session mounts an adapter with
`Retry(total=5, backoff_factor=0.2, status_forcelist=[429, 500, 502, 503, 504])`.
- **Flow.** `authenticate()` → `create` (+ poll `prompt` every 2s up to a 600s
deadline, answering `pending_input` prompts) → `get_titles()` → `get_tracks()`
deadline, answering `pending_input` prompts; with stdin closed the client logs an
error and raises `SystemExit(1)` instead of posting an empty answer) → `get_titles()` → `get_tracks()`
(merging returned `session_headers`/`session_cookies`, re-parsing `manifests`) →
license via proxy or `server_cdm` → `close()` (`DELETE`, saving any returned
`cache`).