Compare commits

..

No commits in common. "c6ef14ee70fe10f712a627d96ac1fb687d981ae3" and "a6060cdbfbc6b98b390efa7b7d03e84a47b7663c" have entirely different histories.

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 occurred when downloading the video."); originalMessage.edit("An error occured 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 {