This package will fetch youtube captions and chapters.
NOTE: This is a rebuild of Algolia's YouTube scraper that includes additional functionalities for my own use case.
$ npm install --save youtube-subs
import { YoutubeSubs, YoutubeChapters } from 'youtube-subs';
// Fetch all captions
const captions = await YoutubeSubs.getSubs(videoId, options);
// Fetch all chapters and its captions
const chapters = await YoutubeSubs.getSubsByChapter(videoId, options);
// Fetch captions by time in seconds
const captions = await YoutubeSubs.getSubsByTime(videoId, from, to, options);
// Fetch all chapters without captions
const chapters = await YoutubeChapters.getChapters(videoId);
Key | Description | Default |
---|---|---|
lang |
Field name specified in the form | en |