Compare commits

..

No commits in common. "e8fc57394f57150ba403117be732d907976cfa56" and "b095d5ce3a045cc22f5d7fa67f2042c1ed01a2d0" have entirely different histories.

2 changed files with 5 additions and 4 deletions

View file

@ -126,10 +126,10 @@ export default {
const aproxFileSize = await utils.getVideoSize(url); const aproxFileSize = await utils.getVideoSize(url);
if (aproxFileSize > 100 && !args.compress) { if (aproxFileSize > 100 && !args.compress) {
return await interaction.followUp('Uh oh! The video you tried to download is larger than 100 mb! Try again with compression.', { ephemeral: true }); await interaction.followUp('Uh oh! The video you tried to download is larger than 100 mb! Try again with compression.', { ephemeral: true });
} }
else if (aproxFileSize > 500) { else if (aproxFileSize > 500) {
return await interaction.followUp('Uh oh! The video you tried to download is larger than 500 mb!', { ephemeral: true }); await interaction.followUp('Uh oh! The video you tried to download is larger than 500 mb!', { ephemeral: true });
} }
download(url, interaction); download(url, interaction);
@ -137,7 +137,8 @@ export default {
}; };
async function download(url, interaction, originalInteraction) { async function download(url, interaction, originalInteraction) {
let format = undefined; let format = 'bestvideo*+bestaudio/best';
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()
.setColor(interaction.member ? interaction.member.displayHexColor : 'Navy') .setColor(interaction.member ? interaction.member.displayHexColor : 'Navy')
.setAuthor({ name: `Downloaded by ${interaction.user.username}`, iconURL: interaction.user.displayAvatarURL(), url: url }) .setAuthor({ name: `Downloaded by ${interaction.user.username}`, iconURL: interaction.user.displayAvatarURL(), url: url })

View file

@ -12,7 +12,7 @@ export default {
getVideoSize, getVideoSize,
getMaxFileSize, getMaxFileSize,
}; };
async function downloadVideo(urlArg, output, format = 'bestvideo[height<=?720]*+bestaudio/best') { async function downloadVideo(urlArg, output, format = 'bestvideo*+bestaudio/best') {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
exec(`./bin/yt-dlp -f "${format}" "${urlArg}" -o "${os.tmpdir()}/${output}.%(ext)s" --force-overwrites --no-playlist --remux-video=mp4/webm/mov`, (err, stdout, stderr) => { exec(`./bin/yt-dlp -f "${format}" "${urlArg}" -o "${os.tmpdir()}/${output}.%(ext)s" --force-overwrites --no-playlist --remux-video=mp4/webm/mov`, (err, stdout, stderr) => {
if (err) { if (err) {