summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/videos.js9
-rw-r--r--mongo-edu.js3
-rw-r--r--package.json7
3 files changed, 13 insertions, 6 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'];
diff --git a/mongo-edu.js b/mongo-edu.js
index 67a8676..eb74d66 100644
--- a/mongo-edu.js
+++ b/mongo-edu.js
@@ -12,9 +12,10 @@ var mdbvideos = require('./lib/login'),
colors = require('colors'),
inquirer = require('inquirer'),
argv = require('optimist')
- .usage('Usage: $0 -d [download path] -u [user name] -h [get handouts] --ncc [no check certificate]')
+ .usage('Usage: $0 -d [download path] -u [user name] -h [get handouts] --cc [get closed captions] --ncc [no check certificate]')
.describe('d', 'download path').describe('u', 'email address')
.describe('h', 'switch from videos (default) to handouts').boolean('h')
+ .describe('cc', 'get closed captions').boolean('cc')
.describe('ncc', 'no check certificate with py3.x').boolean('ncc')
.demand('d').argv;
diff --git a/package.json b/package.json
index 2095fb9..af757d1 100644
--- a/package.json
+++ b/package.json
@@ -1,9 +1,9 @@
{
"name": "mongo-edu",
"preferGlobal": true,
- "version": "0.1.9",
+ "version": "0.1.10",
"author": "Przemyslaw Pluta <przemyslawplutadev@gmail.com> (http://przemyslawpluta.com)",
- "description": "Select and download videos and handouts from education.mongodb.com courses",
+ "description": "Select and download videos and handouts from university.mongodb.com courses",
"main": "./mongo-edu",
"scripts": {
"start": "node ./bin/mongo-edu"
@@ -18,10 +18,13 @@
"keywords": [
"mongodb",
"download",
+ "handouts",
+ "closed captions"
"videos",
"youtube",
"course",
"education",
+ "university",
"edu"
],
"license": "MIT",