summaryrefslogtreecommitdiff
path: root/lib/videos.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/videos.js')
-rw-r--r--lib/videos.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/videos.js b/lib/videos.js
index 19f1730..d8c9062 100644
--- a/lib/videos.js
+++ b/lib/videos.js
@@ -70,10 +70,10 @@ var handleList = function handleList(list, tags) {
dlh = progress(request(item), { throttle: 0 });
- console.log('[' + 'i'.magenta + '] Downloading: ' + name.cyan);
+ console.log('i'.magenta + ' Downloading: ' + name.cyan);
dlh.on('progress', function(state) {
- if (!bar) { bar = new ProgressBar('[' + '>'.green + '] ' + filesize(state.total) + ' [:bar] :percent :etas', { complete: '=', incomplete: ' ', width: 20, total: 100 }); }
+ if (!bar) { bar = new ProgressBar('>'.green + ' ' + filesize(state.total) + ' [:bar] :percent :etas', { complete: '=', incomplete: ' ', width: 20, total: 100 }); }
if (!bar.complete && progressSoFar !== state.percent) {
var i;
for (i = 0; i < (state.percent - hold); i++) { bar.tick(); }
@@ -93,19 +93,19 @@ var handleList = function handleList(list, tags) {
extname = path.extname(name);
if (!uz || (extname !== '.zip')) {
- console.log('[' + 'i'.green + '] Done.' + left);
+ console.log('i'.green + ' Done.' + left);
return nextItem(currentList);
}
unzipFile = fs.createReadStream(downloadPath + name).pipe(unzip.Extract({ path: downloadPath + path.basename(name, extname) }));
unzipFile.on('error', function error() {
- console.log('[' + 'i'.red + '] Unable to unzip ' + name.red + ' try manually.');
+ console.log('i'.red + ' Unable to unzip ' + name.red + ' try manually.');
rimraf(downloadPath + name.replace('.zip', ''), function rf() { nextItem(currentList); });
});
unzipFile.on('close', function close() {
- console.log('[' + 'i'.green + '] Done.' + left);
+ console.log('i'.green + ' Done.' + left);
cleanup(downloadPath + name, currentList);
});
@@ -131,7 +131,7 @@ var handleList = function handleList(list, tags) {
left = (currentList.length)? ' ' + currentList.length + ' left ...' : '';
if (exists) {
- console.log('[' + '>'.magenta + '] ' + name + ' has already been downloaded.' + left);
+ console.log('>'.magenta + ' ' + name + ' has already been downloaded.' + left);
return handleList(currentList);
}
@@ -151,9 +151,9 @@ var handleList = function handleList(list, tags) {
size = info.size;
stash = info;
if (co) { downloadList.push({id: item, name: path.basename(info.filename)}); }
- console.log('[' + 'i'.magenta + '] Downloading: ' + info.filename.cyan + ' > ' + item);
- bar = new ProgressBar('[' + '>'.green + '] ' + filesize(size) + ' [:bar] :percent :etas', { complete: '=', incomplete: ' ', width: 20, total: parseInt(size, 10) });
- console.time('[' + 'i'.magenta + '] ' + info.filename + '. Done in');
+ console.log('i'.magenta + ' Downloading: ' + info.filename.cyan + ' > ' + item);
+ bar = new ProgressBar('>'.green + ' ' + filesize(size) + ' [:bar] :percent :etas', { complete: '=', incomplete: ' ', width: 20, total: parseInt(size, 10) });
+ console.time('i'.magenta + ' ' + info.filename + '. Done in');
dl.pipe(fs.createWriteStream(downloadPath + info.filename));
});
@@ -163,7 +163,7 @@ var handleList = function handleList(list, tags) {
dl.on('error', function error(err) {
if (err.message.indexOf('video doesn\'t have subtitles') !== -1) {
- console.log('[' + 'i'.magenta + '] No Closed Captions Available For: ' + stash.filename.cyan + ' > ' + item);
+ console.log('i'.magenta + ' No Closed Captions Available For: ' + stash.filename.cyan + ' > ' + item);
return getVideos(item, _.without(opt, '--write-sub', '--srt-lang=en'));
}
console.log(err.stack);
@@ -171,8 +171,8 @@ var handleList = function handleList(list, tags) {
dl.on('end', function end() {
var left = (currentList.length)? currentList.length + ' left ...' : '';
- console.timeEnd('[' + 'i'.magenta + '] ' + stash.filename + '. Done in');
- if (left) { console.log('[' + 'i'.magenta + '] ' + left); }
+ console.timeEnd('i'.magenta + ' ' + stash.filename + '. Done in');
+ if (left) { console.log('i'.magenta + ' ' + left); }
handleList(currentList, tags);
});
};
@@ -203,7 +203,7 @@ module.exports = {
setOptions(argv);
- var bar = new ProgressBar('[' + '>'.magenta + '] Collecting [:bar] :percent', { complete: '=', incomplete: ' ', width: 20, total: opt.length }),
+ var bar = new ProgressBar('>'.magenta + ' Collecting [:bar] :percent', { complete: '=', incomplete: ' ', width: 20, total: opt.length }),
options = (!ncc) ? [] : ['--no-check-certificate'];
var isFinished = function isFinished(count, items) {