MCPcopy Create free account
hub / github.com/bjsi/incremental-everything / getTranscriptForRange

Function getTranscriptForRange

src/lib/youtube_transcript.ts:68–80  ·  view source on GitHub ↗
(
    videoIdOrUrl: string,
    startTime: number,
    endTime: number,
    lang?: string
)

Source from the content-addressed store, hash-verified

66 });
67 console.log(
68 `[YT-Transcript] ${videoId}: ${transcript.segments.length} lines, ${transcript.language} (${transcript.kind})` +
69 (transcript.cached ? ', cached' : '')
70 );
71 return transcript;
72}
73
74/** The lines overlapping a time range, in seconds. */
75export function segmentsInRange(segments: TranscriptSegment[], startTime: number, endTime: number) {
76 return segments.filter((s) => s.offset + s.duration > startTime && s.offset < endTime);
77}

Callers 2

handleSetEndFunction · 0.90

Calls 1

fetchTranscriptFunction · 0.85

Tested by

no test coverage detected