yakuroot / youtube-subs-json

Get captions as json from youtube by youtube-dl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

youtube-subs-json

Get captions as json from youtube by youtube-dl

Installation

  • > npm install youtube-subs-json

Usage

const getSubtitles = require('youtube-subs-json').getSubtitles;

getSubtitles({
  videoID: 'XXXXX', // youtube video id or url
  lang: 'ru' // default: `en`
}).then( captions => {
  console.log(captions)
}).catch( err => {
  console.error(err)
})

Captions will be an array of object of this format:

{
  "begin": String, // 00:00:03.419
  "end": String,   // 00:00:10.320
  "start": Number, // 3.419
  "dur": Number,   // 6.901
  "text": String   // some phrase
}

About

Get captions as json from youtube by youtube-dl

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%