From 57e6488b028ec622ae98add514183d12a3ec8fca Mon Sep 17 00:00:00 2001 From: loicbersier Date: Mon, 28 Oct 2019 14:41:19 +0100 Subject: [PATCH] Make sure the vid is mp4 --- commands/fun/vidshittifier.js | 2 +- commands/fun/ytp.js | 2 +- commands/utility/download.js | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/commands/fun/vidshittifier.js b/commands/fun/vidshittifier.js index 300e76c5..5ecdb0cf 100644 --- a/commands/fun/vidshittifier.js +++ b/commands/fun/vidshittifier.js @@ -56,7 +56,7 @@ class vidshittifierCommand extends Command { let loadingmsg = await message.channel.send('Processing '); if (url) { - return youtubedl.exec(url, ['--merge-output-format', 'mp4', '-o', input], {}, function(err) { + return youtubedl.exec(url, ['--format=mp4', '-o', input], {}, function(err) { if (err) { console.error(err); loadingmsg.delete(); diff --git a/commands/fun/ytp.js b/commands/fun/ytp.js index cee0e9bc..f1963062 100644 --- a/commands/fun/ytp.js +++ b/commands/fun/ytp.js @@ -63,7 +63,7 @@ class ytpCommand extends Command { } if (url) { - return youtubedl.exec(url, ['--merge-output-format', 'mp4', '-o', `./asset/ytp/userVid/${message.id}.mp4`], {}, function(err) { + return youtubedl.exec(url, ['--format=mp4', '-o', `./asset/ytp/userVid/${message.id}.mp4`], {}, function(err) { if (err) { console.error(err); loadingmsg.delete(); diff --git a/commands/utility/download.js b/commands/utility/download.js index 9d94ff5d..1fc366aa 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -50,13 +50,12 @@ class DownloadCommand extends Command { if (err); }); } - return youtubedl.exec(args.link, ['--merge-output-format', 'mp4', '-o', `${os.tmpdir()}/${fileName}.mp4`], {}, async function(err, output) { + return youtubedl.exec(args.link, ['--format=mp4', '-o', `${os.tmpdir()}/${fileName}.mp4`], {}, async function(err) { if (err) { console.error(err); loadingmsg.delete(); return message.channel.send('An error has occured, I can\'t download from the link you provided.'); } - console.log(output.join('\n')); let file = fs.statSync(`${os.tmpdir()}/${fileName}.mp4`); let fileSize = file.size / 1000000.0;