summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprzemyslawpluta <przemekpluta@hotmail.com>2014-09-27 13:26:28 +0100
committerprzemyslawpluta <przemekpluta@hotmail.com>2014-09-27 13:26:28 +0100
commit3933a61a27a8d19272322d8f18b8111d70740993 (patch)
tree68918f54ce3bb5a939185fd41185b1e5bdf6d0fc
parent67309cacdee13279d07e2f38ea6435539ed13da3 (diff)
downloadmongo-edu-3933a61a27a8d19272322d8f18b8111d70740993.zip
print debug info for .getInfo with --verbose
-rw-r--r--lib/videos.js7
-rw-r--r--package.json2
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/videos.js b/lib/videos.js
index f569407..a71d4e3 100644
--- a/lib/videos.js
+++ b/lib/videos.js
@@ -19,7 +19,8 @@ var path = require('path'),
mv = require('mv'),
_ = require('lodash');
-var downloadPath = '', proxy = '', downloadList = [], co = false, ncc = false, handout = false, cc = false, uz = false, hq = false, verbose = false;
+var isDebug = /[debug]/, downloadPath = '', proxy = '', downloadList = [],
+ co = false, ncc = false, handout = false, cc = false, uz = false, hq = false, verbose = false;
function setOptions(argv) {
@@ -239,6 +240,8 @@ module.exports = {
youtubedl.getInfo(item, options, function(err, info) {
+ if (verbose && isDebug.test(err)) { console.log(err); }
+
items.push((!err)?{name: info.title + ' - ' + info.resolution, value: item, id: i}:{name: 'No info: ' + item, value: item, id: i});
count = count - 1;
@@ -307,6 +310,8 @@ module.exports = {
youtubedl.getInfo(opt.url, options, function(err, info) {
+ if (verbose && isDebug.test(err)) { console.log(err); }
+
if (info.length) {
for (i = 0; i < info.length; i++) {
item = 'https://www.youtube.com/watch?v=' + info[i].id;
diff --git a/package.json b/package.json
index 03d5ce6..fd90e2f 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "mongo-edu",
"preferGlobal": true,
- "version": "0.1.37",
+ "version": "0.1.38",
"author": "Przemyslaw Pluta <przemyslawplutadev@gmail.com> (http://przemyslawpluta.com)",
"description": "Select and download videos and handouts from university.mongodb.com courses",
"main": "./mongo-edu",