summaryrefslogtreecommitdiff
path: root/lib
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 /lib
parent67309cacdee13279d07e2f38ea6435539ed13da3 (diff)
downloadmongo-edu-3933a61a27a8d19272322d8f18b8111d70740993.zip
print debug info for .getInfo with --verbose
Diffstat (limited to 'lib')
-rw-r--r--lib/videos.js7
1 files changed, 6 insertions, 1 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;