Skip to content

Add URL-based transcript range slicing for insert and side-panel flows#89

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/fetch-transcript-specific-time-range
Draft

Add URL-based transcript range slicing for insert and side-panel flows#89
Copilot wants to merge 4 commits into
masterfrom
copilot/fetch-transcript-specific-time-range

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

Users currently have to fetch full transcripts and manually trim content, which is cumbersome for long videos. This change adds first-class support for requesting only a specific segment (e.g. 2:48 to 7:59) directly from the YouTube URL.

  • Time-range parsing from YouTube URLs

    • Added extractYouTubeTimeRange(url) in src/youtube/url.ts.
    • Supports start, end, t, and #t= inputs with common formats (mm:ss, hh:mm:ss, 2m48s, raw seconds).
    • Normalizes to millisecond bounds and drops invalid end bounds (end <= start).
  • Transcript line range filtering

    • Added filterTranscriptLinesByRange(...) in src/transcript/range.ts.
    • Uses overlap semantics so lines intersecting the requested window are retained.
  • Applied to both transcript output paths

    • src/transcript/format.ts: insert command output is now range-aware.
    • src/obsidian/views/transcript-view.ts: side-panel rendering is now range-aware.
    • Side-panel timestamp links now use buildTimestampUrl(...) for consistent URL handling.
  • User-facing docs update

    • README now documents segment usage via URL parameters for both workflows.
const url =
  "https://www.youtube.com/watch?v=dQw4w9WgXcQ&start=2:48&end=7:59";

const range = extractYouTubeTimeRange(url);
// { startMs: 168000, endMs: 479000 }

const linesInRange = filterTranscriptLinesByRange(transcript.lines, range);

Copilot AI linked an issue May 8, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add feature to fetch transcript for specific time range Add URL-based transcript range slicing for insert and side-panel flows May 8, 2026
Copilot AI requested a review from lstrzepek May 8, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fetch transcript for specific time range

2 participants