fix hidden download no longer working
This commit is contained in:
parent
f4ada16552
commit
b072cda0d6
1 changed files with 4 additions and 4 deletions
|
@ -127,7 +127,7 @@ class DownloadController {
|
||||||
let video = youtubedl(data.url, ['--format=mp4', '-f', option]);
|
let video = youtubedl(data.url, ['--format=mp4', '-f', option]);
|
||||||
|
|
||||||
video.on('error', function(err) {
|
video.on('error', function(err) {
|
||||||
console.error(err);
|
//console.error(err);
|
||||||
return view.render(page, {
|
return view.render(page, {
|
||||||
title: title,
|
title: title,
|
||||||
viewCounter: viewCounter,
|
viewCounter: viewCounter,
|
||||||
|
@ -144,14 +144,14 @@ class DownloadController {
|
||||||
ext = info.ext;
|
ext = info.ext;
|
||||||
let title = info.title.slice(0,50);
|
let title = info.title.slice(0,50);
|
||||||
DLFile = `${title.replace(/\s/g, '_')}.${ext}`;
|
DLFile = `${title.replace(/\s/g, '_')}.${ext}`;
|
||||||
|
DLFile = DLFile.replace(/[()]|[/]|[\\]/g, '_');
|
||||||
|
|
||||||
// If no title use the ID
|
// If no title use the ID
|
||||||
if (title == '_') title = `_${info.id}`;
|
if (title == '_') title = `_${info.id}`;
|
||||||
// If user want to hide from the feed
|
// If user want to hide from the feed
|
||||||
if (data.feed == 'on')
|
if (data.feed == 'on')
|
||||||
DLFile = `hidden/${title.replace(/\s/g, '_')}.${ext}`;
|
DLFile = `hidden/${title}.${ext}`;
|
||||||
|
|
||||||
DLFile = DLFile.replace(/[()]|[/]|[\\]/g, '_');
|
|
||||||
video.pipe(fs.createWriteStream(`./public/uploads/${DLFile}`));
|
video.pipe(fs.createWriteStream(`./public/uploads/${DLFile}`));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue