@joegesualdo/get-youtube-subtitles-node

Get the subtitles of a youtube video.

Stats

StarsIssuesVersionUpdatedCreatedSize
@joegesualdo/get-youtube-subtitles-node
1720.1.03 years ago5 years agoMinified + gzip package size for @joegesualdo/get-youtube-subtitles-node in KB

Readme

@joegesualdo/get-youtube-subtitles-node Build Status

Get the subtitles of a youtube video.

Install

$ npm install --save @joegesualdo/get-youtube-subtitles-node 

Usage

var getYoutubeSubtitles = require('@joegesualdo/get-youtube-subtitles-node');

let videoId = 'q_q61B-DyPk'

getYoutubeSubtitles(videoId)
.then(subtitles => {
  console.log(subtitles)
})
.catch(err => {
  console.log(err)
})

Test

$ npm test

API

getYoutubeSubtitles(youtubeVideoId, options)

Returns a promise that passes the resulting subtitles json.

Name Type Description
youtubeVideoId Number The id of the video you want to get the subtitles for

Options

Name Type Default Options Description
type String either auto, nonauto, either The id of the video you want to get the subtitles for

Returns: Promise, that passes the resulting subtitles.

var getYoutubeSubtitles = require('@joegesualdo/get-youtube-subtitles-node');

let videoId = 'q_q61B-DyPk'

getYoutubeSubtitles(videoId, {type: 'nonauto'})
.then(subtitles => {
  console.log(subtitles)
})
.catch(err => {
  console.log(err)
})

Build

$ npm run build

Related

License

MIT © Joe Gesualdo

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.