@rolme/ytscript
Version:
A CLI tool to download YouTube transcripts and generate summaries
17 lines (16 loc) • 751 B
JavaScript
export { getTranscript } from './services/transcript/index.js';
export { TranscriptError } from './errors.js';
export { AIError } from './types/ai.js';
import { getTranscript } from './services/transcript/index.js';
import ytdl from 'ytdl-core';
import { SummaryService } from './services/summary.js';
export async function getVideoTranscript(url, options = {}) {
const info = await ytdl.getInfo(url);
return getTranscript(info, options);
}
export async function summarizeVideo(url, options = {}) {
const transcript = await getVideoTranscript(url, options);
const summaryService = new SummaryService(options);
const { style, maxLength } = options;
return summaryService.summarizeTranscript(transcript, { style, maxLength });
}