feat(config): resolve media URLs + URL timestamps in config-driven video (parity with quick playback)#38
Merged
Conversation
…deo (parity with quick playback) A video scene's `file` could only be a local path or a direct media URL in config mode — a YouTube/etc. page was handed straight to PyAV and failed with ffmpeg's "Invalid data found". Now config-driven video resolves URLs the same way quick playback does, so both interfaces behave identically. - quickcast.resolve_video_url is the single, shared resolver (yt-dlp resolution + audio-only rejection + t=/start=/#t= timestamp). build_scene calls it for a single-URL video `file`, folding the URL timestamp into start_s (an explicit start_s wins) and using the resolved title as the scene name. - quickcast.classify_url no longer pre-resolves: it stores the URL verbatim and parses the timestamp offline, so resolution happens once, in build_scene, for both the positional MEDIA path and configs. - --doctor / config load now flag (offline) a single URL that needs yt-dlp when the `yt` extra is missing, with an install hint — instead of the cryptic runtime ffmpeg failure. Direct media URLs need no extra. Docs (CLAUDE.md, usage.md, example TOML) updated. Tests: shared resolver, url_needs_ytdlp, build_scene URL resolution + timestamp/title wiring, and the offline yt-extra doctor check.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
=======================================
Coverage 79.54% 79.55%
=======================================
Files 68 68
Lines 12817 12847 +30
Branches 1889 1896 +7
=======================================
+ Hits 10195 10220 +25
- Misses 2185 2188 +3
- Partials 437 439 +2 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A video scene's
fileonly accepted local paths or direct media URLs in config mode. A YouTube (or any yt-dlp) page URL was passed straight to PyAV, which failed at playback with ffmpeg's crypticInvalid data found when processing input. yt-dlp resolution (and the?t=start-offset parsing) only happened in the positionalc64cast MEDIA…quick-playback path. This brings the two interfaces to parity.What
quickcast.resolve_video_url(yt-dlp resolution +audio-only rejection +
t=/start=/#t=timestamp).config.build_scenecalls it for a single-URL video
file, folding the URL timestamp intostart_s(an explicitstart_sstill wins) and using the resolved title asthe scene name. Local file / dir / glob / multi specs are untouched.
quickcast.classify_urlno longer pre-resolves;it stores the URL verbatim and parses the timestamp offline, so resolution
happens once, in
build_scene, for both the positional path and configs.--doctorand config load now flag (offline) asingle URL that needs yt-dlp when the
ytextra is missing, with an installhint, instead of the runtime ffmpeg failure. Direct media URLs need no extra.
Docs
CLAUDE.md (quickcast + config sections), docs/usage.md (
type = "video"), andthe example TOML document URL
filespecs + the timestamp behavior.Tests
resolve_video_url(video tuple / audio rejection),url_needs_ytdlp.build_sceneURL resolution: stream URL + timestamp→start_s+ title→name;explicit
start_swins; audio-only rejected. (yt-dlp + network faked.)direct URLs exempt.
Full suite green; schema unchanged (no new field).