get-youtube-subtitles-node
get-youtube-subtitles-node copied to clipboard
Error with the example
Hello, im trying to run this example, but im getting this error, with Node 8 LTS on Ubuntu:
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)
})
The error:
~/dev/subs $ nodejs app.js
/home/matias/dev/subs/node_modules/@joegesualdo/get-youtube-subtitles-node/index.js:7
let type = options.type || 'either';
^
TypeError: Cannot read property 'type' of undefined
at getYoutubeSubtitles (/home/matias/dev/subs/node_modules/@joegesualdo/get-youtube-subtitles-node/index.js:7:22)
at Object.<anonymous> (/home/matias/dev/subs/app.js:5:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
I have the same error. the function takes another parameter options which take one of the values : auto, nonauto, either. so you call the function like that : getYoutubeSubtitles('q_q61B-DyPk', {type: 'nonauto'})
facing the same issue here !
I have the same error.
just pass empty object, for example getYoutubeSubtitles(videoId, {})
I have tried both 'auto' and 'nonauto' as optional parameter. getYoutubeSubtitles(videoId, { type: 'nonauto' }) Unfortunately, I am always getting "Subtitles dont exist for video_id_goes_here" error?