From b01c24244ff88d1dab4304353bfccb35e7c3c48f Mon Sep 17 00:00:00 2001 From: astar76 Date: Wed, 25 Nov 2026 22:40:06 -0600 Subject: [PATCH 01/56] S025: yt-dlp video sites: finder, probe, run, error kinds, video page, test file Co-Authored-By: Claude Sonnet 5.5 --- Plans/06 Media/S025-video-sites.md | 14 +- Plans/INDEX.md | 2 +- crates/app/src/views/mod.rs | 1 + crates/app/src/views/video.rs | 147 +++++++ crates/core/lang/en.json | 29 +- crates/core/src/lib.rs | 1 + crates/core/src/ytdlp.rs | 622 +++++++++++++++++++++++++++++ docs/PROGRESS.md | 4 + docs/tests/S025-video-sites.md | 40 ++ 9 files changed, 851 insertions(+), 9 deletions(-) create mode 100644 crates/app/src/views/video.rs create mode 100644 crates/core/src/ytdlp.rs create mode 100644 docs/tests/S025-video-sites.md diff --git a/Plans/06 Media/S025-video-sites.md b/Plans/06 Media/S025-video-sites.md index bb49b0e..87fe03d 100644 --- a/Plans/06 Media/S025-video-sites.md +++ b/Plans/06 Media/S025-video-sites.md @@ -12,13 +12,13 @@ FEATURES 6.1 with the system's yt-dlp (D-011). - `yt-dlp --help` (format, output, progress parts) ## Steps -- [ ] Finder and version check, missing and too-old states in plain words -- [ ] Probe to JSON: formats, audio, subtitles, chapters, playlists; cached and cancellable -- [ ] Add dialog page: quality choice with sizes, audio only, subtitles, playlist picker -- [ ] Run as a task: progress template parsed to parts and speed, pause by stop and resume, limits passed on, cookies through a private temp file -- [ ] Errors mapped to kinds: private, removed, region, login, unsupported, too many requests; DRM refused -- [ ] Test file `docs/tests/S025-video-sites.md`, with the checks below -- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S025: …`, push +- [x] Finder and version check, missing and too-old states in plain words +- [x] Probe to JSON: formats, audio, subtitles, chapters, playlists; cached and cancellable +- [x] Add dialog page: quality choice with sizes, audio only, subtitles, playlist picker +- [x] Run as a task: progress template parsed to parts and speed, pause by stop and resume, limits passed on, cookies through a private temp file +- [x] Errors mapped to kinds: private, removed, region, login, unsupported, too many requests; DRM refused +- [x] Test file `docs/tests/S025-video-sites.md`, with the checks below +- [x] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S025: …`, push ## End criteria `nice cargo check -q -j 2 -p medlar` clean diff --git a/Plans/INDEX.md b/Plans/INDEX.md index 00e2ee1..ac1d598 100644 --- a/Plans/INDEX.md +++ b/Plans/INDEX.md @@ -44,7 +44,7 @@ Tracker: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H ## 06 Media -- [ ] [S025](06%20Media/S025-video-sites.md) Video sites through yt-dlp +- [x] [S025](06%20Media/S025-video-sites.md) Video sites through yt-dlp ## 07 Library and tools diff --git a/crates/app/src/views/mod.rs b/crates/app/src/views/mod.rs index a6ee3da..889ffd6 100644 --- a/crates/app/src/views/mod.rs +++ b/crates/app/src/views/mod.rs @@ -15,3 +15,4 @@ pub mod queues; pub mod rail; pub mod schedule; pub mod settings; +pub mod video; diff --git a/crates/app/src/views/video.rs b/crates/app/src/views/video.rs new file mode 100644 index 0000000..36352f7 --- /dev/null +++ b/crates/app/src/views/video.rs @@ -0,0 +1,147 @@ +//! The Add dialog's page for a video site: quality with sizes, audio only, subtitles, the videos of a playlist. +//! It holds what was asked and what was chosen; `choice` gives the core what to run. The dialog owns the probe's task. + +use crate::theme::Theme; +use crate::tokens::{space, text}; +use crate::ui::odometer::amount; +use crate::ui::widgets::Choice as Pick; +use eframe::egui::{RichText, ScrollArea, Ui}; +use medlar_core::ytdlp::{Choice, Probe, Quality}; +use medlar_core::{strings, tr}; +use std::sync::Arc; + +/// Rows of the playlist that are seen at once. +const SEEN: f32 = 220.0; + +/// Where the page is. +pub enum Page { + Looking, + /// In plain words, what failed and why. + Failed(String), + Ready(Box