Compare commits
2 commits
a6060cdbfb
...
c6ef14ee70
Author | SHA1 | Date | |
---|---|---|---|
c6ef14ee70 | |||
e68bb41960 |
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue