diff options
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']; |