Make sure the vid is mp4

merge-requests/4/head
loicbersier 5 years ago
parent 89b2460ed4
commit 57e6488b02

@ -56,7 +56,7 @@ class vidshittifierCommand extends Command {
let loadingmsg = await message.channel.send('Processing <a:loadingmin:527579785212329984>');
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();

@ -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();

@ -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;

Loading…
Cancel
Save