Unofficial YouTube transcript fetcher for Node.js (v1.3.1). Extracts captions/subtitles from YouTube videos using undocumented internal APIs. Published as an ESM-only package with TypeScript types; requires Node >=18. Simple API: one function `fetchTranscript`. No dependencies. May break without notice if YouTube changes its API. Less feature-rich than youtubei.js or ytdl-core but minimal and focused on transcripts alone. Sporadic releases.
npm install youtube-transcriptNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Fetches English transcript for a sample video and logs the array of text segments with duration and offset.
Monitor the repo for updates; consider youtubei.js or ytdl-core for more stable YouTube access.
Upgrade Node.js to >=18 or use a build tool that transforms ESM.
Use dynamic import: `const { fetchTranscript } = await import('youtube-transcript');` in CJS projects.Check if the video has captions before calling, or handle the error gracefully.
Test with those URL formats; may require workaround or alternative library.
Change to import statement or use dynamic import: await import('youtube-transcript')Verify video has captions and specify a valid language code (e.g., 'en').
Use { fetchTranscript } from 'youtube-transcript'Double-check the video ID/URL; if valid, API may have changed – check for library updates.
No dependency data recorded yet.