@joegesualdo/get-youtube-subtitles-node

0.1.0 • Public • Published

@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

Package Sidebar

Install

npm i @joegesualdo/get-youtube-subtitles-node

Weekly Downloads

97

Version

0.1.0

License

MIT

Unpacked Size

18 kB

Total Files

7

Last publish

Collaborators

  • joegesualdo