WebVTT to .srt converter. Sometimes bad internet connection leaves you no option but to download some videos instead of watching them in your browser. But those videos often come with closed captions in WebVTT, and this format is not widely supported in media players yet.
npm install vtt2srt
bower install vtt2srt
Or download and include vtt2srt.js manually in your page.
var fs = require('fs');
var vtt2srt = require('vtt2srt');
var vtt = fs.readFile('captions.vtt', function (err, captionsBuff) {
console.log(vtt2srt(vtt));
});
node bin/convert.js < elephants_dream.vtt > elephants_dream.srt