Skip to content

feat(video): keep a video on disk and search it without reading it again - #10

Merged
maxgfr merged 1 commit into
mainfrom
issue-7-video-run
Sep 30, 2026
Merged

maxgfr merged 1 commit into
mainfrom
issue-7-video-run

Conversation

@maxgfr

@maxgfr maxgfr commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Second of four PRs for #7.

  • webindex video fetch <url> writes <dir>/<videoId>/TRANSCRIPT.md, segments.json and meta.json, and reuses them on the next call without running yt-dlp at all; --refresh reads the video again, --lang picks the subtitle language.
  • webindex video search <query> ranks ~45 s passages of every kept video (or one video's directory) with BM25F, chapter titles weighted as headings; each hit carries its [mm:ss] stamp and a &t=Ns link.
  • The directory is --out <dir> (new value flag), else WEBINDEX_VIDEO_DIR, else <tmp>/<brand>/video. Under WEBINDEX_NO_WRITE nothing is written and fetch prints the transcript.
  • Library: videoRoot, fetchVideoRun, readVideoRun, listVideoRuns, searchVideoRuns.

Checked live: a 20-min TED talk fetched in 3.4 s, then served again in 0.04 s with no yt-dlp call; search finds the right passages across an English talk and a French auto-captioned video.

webindex video fetch writes <dir>/<id>/TRANSCRIPT.md, segments.json and
meta.json, and reuses them on the next call without running yt-dlp;
--refresh reads the video again. webindex video search ranks ~45 s passages
of every kept video with BM25F, chapter titles as headings, each with its
stamp and a link that opens the video there. The directory is --out, else
WEBINDEX_VIDEO_DIR, else <tmp>/<brand>/video.

Refs #7
@maxgfr
maxgfr merged commit 93d2274 into main Sep 30, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.23.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@maxgfr
maxgfr deleted the issue-7-video-run branch September 30, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant