Compare commits

...

2 commits

Author SHA1 Message Date
c6ef14ee70
Fix verbose flag not working
All checks were successful
CI / CI (push) Successful in 1m25s
2025-06-21 15:40:16 +02:00
e68bb41960
Fix typo 2025-06-21 15:35:26 +02:00

View file

@ -39,7 +39,7 @@ module.exports = {
const originalMessage = await message.channel.send("Downloading video...") const originalMessage = await message.channel.send("Downloading video...")
if(this.executeCommand("yt-dlp", [url, "-P", downloadsDir, "--cookies", cookieFilepath]).error){ if(this.executeCommand("yt-dlp", [url, "-P", downloadsDir, "--cookies", cookieFilepath]).error){
originalMessage.edit("An error occured when downloading the video."); originalMessage.edit("An error occurred when downloading the video.");
this.cleanUp(downloadsDir); this.cleanUp(downloadsDir);
return; return;
} }
@ -68,7 +68,7 @@ module.exports = {
fs.rmSync(downloadsDir, {force: true, recursive: true}); fs.rmSync(downloadsDir, {force: true, recursive: true});
}, },
executeCommand(command, commandArgs, {verbose = false}) { executeCommand(command, commandArgs, verbose=false) {
if (typeof command !== 'string' || !Array.isArray(commandArgs)) return { error: true }; if (typeof command !== 'string' || !Array.isArray(commandArgs)) return { error: true };
console.log("Executing:", command, commandArgs.join(" ")); console.log("Executing:", command, commandArgs.join(" "));
try { try {