From 7926820e70bc66c4504f1c63d571e971e01ed2c4 Mon Sep 17 00:00:00 2001 From: Supositware Date: Sat, 31 Aug 2024 15:44:31 +0200 Subject: [PATCH] Fix download format --- commands/utility/vid2gif.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/utility/vid2gif.js b/commands/utility/vid2gif.js index fedbc3a..4e09891 100644 --- a/commands/utility/vid2gif.js +++ b/commands/utility/vid2gif.js @@ -5,7 +5,7 @@ import os from 'node:os'; import path from 'node:path'; import { execFile } from 'node:child_process'; const { NODE_ENV } = process.env; - +const ytdlpFormat = 'bestvideo[height<=?480]/best'; export default { data: new SlashCommandBuilder() @@ -63,14 +63,14 @@ export default { return interaction.editReply({ content: '❌ This does not look like a valid url!', ephemeral: true }); } - const aproxFileSize = await utils.getVideoSize(url, 'bestvideo[height<=?480]'); + const aproxFileSize = await utils.getVideoSize(url, ytdlpFormat); console.log(aproxFileSize); if (aproxFileSize > 4) { return interaction.editReply('The file you are trying to convert is too big! Limit is 4 MB'); }; - utils.downloadVideo(url, interaction.id, 'bestvideo[height<=?480]') + utils.downloadVideo(url, interaction.id, ytdlpFormat) .then(async () => { const file = fs.readdirSync(os.tmpdir()).filter(fn => fn.startsWith(interaction.id)); let output = `${os.tmpdir()}/${file}`;