4.5 KiB
4.5 KiB
S025 — Video sites through yt-dlp: test file
Written by the worker that built it, run by the test phase. Nothing here has been tested until its Result says so.
Built
crates/core/src/ytdlp.rs·Ytdlp::find/at(finder, version check),probe(JSON,Cache, cancel by dropping),start->Running(progress,stop,end),Choice,Run,Progress::read,Reason::of(error kinds), private cookieJar.crates/app/src/views/video.rs·Page,Video(quality radios with sizes, audio only, subtitles, playlist picker); not yet shown by the Add dialog.- Strings
video.*,error.video.*incrates/core/lang/en.json.
Checks
| # | Risk | Do this | Expect | How | Result |
|---|---|---|---|---|---|
| 1 | MED | Ytdlp::find with no yt-dlp on PATH or beside the test |
Problem::Missing, words say to install it |
unit | — |
| 2 | MED | Stub --version prints 2022.01.01 |
Problem::TooOld("2022.01.01"); 2024.08.06, 2025.01.01.1 and 2024.08.06-nightly pass |
unit (stub) | — |
| 3 | MED | Stub that exits 1 or prints junk for --version |
Problem::Broken |
unit (stub) | — |
| 4 | HIGH | Stub replays a recorded -J of one video; call probe |
formats, sizes, subtitles, automatic captions, chapters read; qualities() lists Best then heights descending with video plus best-audio sizes |
unit (stub) | — |
| 5 | MED | Probe a recorded playlist | is_playlist, entries have titles and urls; live_chat is not a subtitle |
unit (stub) | — |
| 6 | MED | Probe the same link twice | the stub ran once (cache); after the keep time it runs again | unit (stub) | — |
| 7 | HIGH | Stub sleeps; end the cancel future during probe |
Error::Stopped at once and the stub process is gone |
unit (stub) | — |
| 8 | HIGH | Probe a recorded answer whose formats are all has_drm |
error of kind Drm, nothing cached |
unit (stub) | — |
| 9 | HIGH | Stub prints recorded progress lines; read Running::progress |
done, total (or estimate), speed, eta, fragment and playlist item match; NA parts are None |
unit (stub) | — |
| 10 | HIGH | start, then stop, then start again with the same folder |
stub sees the same arguments; first process is gone after stop; second goes on |
unit (stub) | — |
| 11 | HIGH | Stub echoes its arguments | starts with --ignore-config; link is last and right after --; a link beginning with - stays an argument; limit gives --limit-rate N; no proxy variables in its environment |
unit (stub) | — |
| 12 | HIGH | Run with cookies; stub reports the cookie file's mode and content | mode 600, content equal; file removed after end and after drop |
unit (stub) | — |
| 13 | HIGH | Recorded failures: private, removed, region, sign-in, unsupported URL, HTTP 429, DRM, unknown | Reason is Private, Removed, Region, Login, Unsupported, TooManyRequests, Drm, Other; each error has its own plain text |
unit | — |
| 14 | MED | Choice with height 720, audio only, subtitles en,de, items |
format selector with height<=720; -x; --write-subs --sub-langs en,de; odd characters in languages or items dropped |
unit | — |
| 15 | MED | Video page: pick items 1, 3, 4, 5 of 6 |
choice().items == "1,3-5"; all picked gives None; none picked gives empty() |
unit | — |
| 16 | LOW | Show the page with a playlist, subtitles and sizes, light and dark | readable, no overlap, list scrolls | screen | — |
| 17 | MED | #[ignore] test: real yt-dlp against the test server's generic page (never a real site) |
file arrives in the folder, end returns its path |
integration | — |
Needs
A stub yt-dlp script (shell) that replays recorded outputs chosen by an environment variable and records its arguments; the test server for check 17; a throwaway XDG_RUNTIME_DIR. Never a real video site.
Doubts
- The progress template and
--print after_move:were written from readingyt-dlp --help, not run; check with the real program (check 17). --flat-playlistfor probing gives playlist entries without sizes; a single video link is fully probed.- Region, login and private are matched by English text in yt-dlp's messages, which may change between releases.
Reason::ofmatches in list order, not line order; "sign in" may hide other causes.- Not wired: the Add dialog does not show
video::Page, and no manager task kind runsYtdlp::start, so the limits of Medlar's limiter are not passed on yet (only a fixedlimit). - Cookies come as the text of a Netscape cookie file; nothing yet converts the connector's
Cookieheader.