diff options
author | przemyslawpluta <przemekpluta@hotmail.com> | 2014-04-02 19:46:42 +0100 |
---|---|---|
committer | przemyslawpluta <przemekpluta@hotmail.com> | 2014-04-02 19:46:42 +0100 |
commit | ae4d98423d51c01c7cacc3c35d0257a745b2b3d0 (patch) | |
tree | ab9c3496b3995f4f52c8aa6db4005e65d57fef7f /lib | |
parent | 71df97153e9f678e6e7ed8cdabe017480bba669a (diff) | |
download | mongo-edu-ae4d98423d51c01c7cacc3c35d0257a745b2b3d0.zip |
add closed caption support
Diffstat (limited to 'lib')
-rw-r--r-- | lib/videos.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/videos.js b/lib/videos.js index 4b8b700..cb07cf8 100644 --- a/lib/videos.js +++ b/lib/videos.js @@ -16,14 +16,16 @@ var path = require('path'), colors = require('colors'), _ = require('lodash'); -var downloadPath = '', ncc = false, handout = false; +var downloadPath = '', ncc = false, handout = false, cc = false; var handleList = function handleList(list) { var currentList = list, - opt = (!ncc) ? ['--max-quality=18'] : ['--max-quality=18', '--no-check-certificate'], + opt = (!ncc) ? ['--max-quality=18'] : ['--max-quality=18', '--no-check-certificate']; - getHandouts = function getHandouts(item) { + if (cc) { opt = opt.concat(['--write-srt', '--srt-lang=en']); } + + var getHandouts = function getHandouts(item) { var name = path.basename(item), bar, dounloadFile, dlh, left, @@ -118,6 +120,7 @@ module.exports = { downloadPath = argv.d; if (argv.ncc) { ncc = true; } if (argv.h) { handout = true; } + if (argv.cc) { cc = true; } var bar = new ProgressBar('[' + '>'.magenta + '] Collecting [:bar] :percent', { complete: '=', incomplete: ' ', width: 20, total: opt.length }), options = (!ncc) ? [] : ['--no-check-certificate']; |