Skip to content

smervs/youtube-subs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Youtube Subs npm version

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.

Installation

$ npm install --save youtube-subs

Usage

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);

Types

Options

Key Description Default
lang Field name specified in the form en

License

MIT