diff --git a/commands/utility/download.js b/commands/utility/download.js index 914dc4b..8f45992 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -66,7 +66,7 @@ class DownloadCommand extends Command { if (err); }); } - return youtubedl.exec(link, ['--recode-video', 'mp4', '-o', `${os.tmpdir()}/${fileName}`], {}, async function(err) { + return youtubedl.exec(link, ['-o', `${os.tmpdir()}/${fileName}`], {}, async function(err) { if (err) { console.error(err); loadingmsg.delete(); @@ -74,11 +74,14 @@ class DownloadCommand extends Command { } let ext = 'mp4'; + if (fs.existsSync(`${os.tmpdir()}/${fileName}`)) { ext = await filetype.fromFile(`${os.tmpdir()}/${fileName}`); ext = ext.ext; // This look stupid but hey, it work if (ext == '3gp') ext = 'mp4'; // Change 3gp file extension to mp4 so discord show the video ( and to stop people from complaining ) fs.renameSync(`${os.tmpdir()}/${fileName}`, `${os.tmpdir()}/${fileName}.${ext}`); + } else if (fs.existsSync(`${os.tmpdir()}/${fileName}.mkv`)) { // If it can't find the video assume it got merged and end with mkv + fs.renameSync(`${os.tmpdir()}/${fileName}.mkv`, `${os.tmpdir()}/${fileName}.mp4`); // Discord play mkv just fine but it need to end with mp4 } let file = fs.statSync(`${os.tmpdir()}/${fileName}.${ext}`);