fix output 2

This commit is contained in:
loicbersier 2020-03-29 03:53:06 +02:00
parent 744844c347
commit 1aa341e0f1

View file

@ -125,15 +125,18 @@ class ytpCommand extends Command {
if (url) { if (url) {
return youtubedl.exec(url, ['--max-filesize', '50m', '--format=mp4', '-o', `./asset/ytp/userVid/${message.id}.mp4`], {}, function(err, output) { return youtubedl.exec(url, ['--max-filesize', '50m', '--format=mp4', '-o', `./asset/ytp/userVid/${message.id}.mp4`], {}, function(err, output) {
console.log(output);
if (err) { if (err) {
console.error(err); console.error(err);
loadingmsg.delete(); loadingmsg.delete();
return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?'); return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?');
} else { } else {
if (output[2]) {
if (output[2].includes('File is larger than max-filesize')) { if (output[2].includes('File is larger than max-filesize')) {
loadingmsg.delete(); loadingmsg.delete();
return message.channel.send(output[2]); return message.channel.send(output[2]);
} }
}
let mp4 = []; let mp4 = [];
fs.readdirSync('./asset/ytp/userVid/').forEach(file => { fs.readdirSync('./asset/ytp/userVid/').forEach(file => {