Better error message for HTTP ERROR 429

merge-requests/5/merge
loicbersier 4 years ago
parent 295acc4ce1
commit 18193e1b78

@ -137,7 +137,11 @@ class ytpCommand extends Command {
if (err) {
console.error(err);
loadingmsg.delete();
return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?');
if (err.includes('HTTP Error 429')) {
return message.channel.send('An error has occured, I can\'t download from the link you provided because the website has blocked the bot. Please try again later or upload that video as mp4 on another website.');
} else {
return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?');
}
} else {
if (output[2]) {
if (output[2].includes('File is larger than max-filesize')) {

@ -76,8 +76,11 @@ class DownloadCommand extends Command {
if (err) {
console.error(err);
loadingmsg.delete();
return message.channel.send('An error has occured, I can\'t download from the link you provided.');
}
if (err.includes('HTTP Error 429')) {
return message.channel.send('An error has occured, I can\'t download from the link you provided because the website has blocked the bot. Please try again later.');
} else {
return message.channel.send('An error has occured, I can\'t download from the link you provided.');
} }
let ext = 'mp4';

Loading…
Cancel
Save