feat(video): read any site yt-dlp supports, not only YouTube - #14
Merged
Merged
Conversation
- fetch sends the common video hosts to the transcript ladder by their URL alone: YouTube, Vimeo (through its player, which needs no login), Dailymotion, Twitch, TED, Loom, TikTok, Instagram reels, Facebook videos, X posts, Bilibili, Rumble; a post there with no video is read as a page - video fetch|frames|list take any http(s) URL and let yt-dlp decide; under an MCP policy only the known hosts (and YouTube's lists), since yt-dlp's own redirects escape the public-address check - runs are keyed <site>-<id> outside YouTube; SRT tracks are read as well as WebVTT; links open at the second in each site's own form; DRM-protected formats are skipped, and a video served only under DRM says so - a search hit's stamp is now the segment that answers, not its passage's start, which could be 40 s early - an MCP video tool's relative dir lands under the video root, not the server's working directory Closes #13
…s apart
- under a policy yt-dlp runs with --use-extractors default,-generic on every
call (probe, subtitles, audio, frames, lists), so a tweet's player card or
a redirect cannot send it to an arbitrary address
- frames download from the caller's approved URL, and a meta.json on disk
is held to the same rules as any other URL
- a video host's post read as a page is cached as a page, with its format
and read mode; any failure on a host that also carries posts falls back to
the page, only YouTube, Vimeo and Dailymotion keep the video's reason
- a page read by the generic extractor, or an id made filesystem-safe, gets
a hash of its URL in its run key: two pages never share a run
- runs are written under the URL's own key, which Twitch VODs, TED talks,
TikTok, X and Loom now have; site names follow knownVideo's
- YouTube listings keep only YouTube videos (no channel tabs); an unguarded
MCP list takes a watch URL that carries list=
- SRT with dotted milliseconds, trailing spaces and {\an8} codes; the DRM
format filter, which filtered nothing, is gone
Refs #13
|
🎉 This PR is included in version 1.26.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Closes #13.
fetch/webindex_fetchsend the common video hosts to the transcript ladder by URL alone: YouTube, Vimeo (read throughplayer.vimeo.com, sincevimeo.comnow asks yt-dlp to log in), Dailymotion, Twitch, TED, Loom, TikTok, Instagram reels, Facebook videos, X posts, Bilibili, Rumble. A post there with no video falls back to the page, with a note (fetchAndExtractgainsvideo: false).video fetch|frames|listtake any http(s) URL and let yt-dlp decide. Under an MCP policy the video tools read only the known hosts (and only YouTube's lists): yt-dlp follows its own redirects, out of the public-address check's sight.<site>-<id>outside YouTube (vimeo-76979871); a known host's run is reused with no yt-dlp call, any other page costs one probe to learn its key.?t=,#t=,?start=, Twitch's?t=1h2m3s).Two defects found while testing for real on https://www.youtube.com/watch?v=TUPyNZO73Sk, fixed here:
dirwas resolved against the server's working directory.Checked live: the Apple Watch guide (French auto-captions, 20 min),
vimeo.com/76979871(manual subtitles through the player; frames refused with the DRM note),vimeo.com/1084537and/22439234(whisper),dai.ly/x7tgad0(SRT), a direct.mp4(whisper), and the MCP tools over stdio.