added support for error 403

This commit is contained in:
loicbersier 2020-05-14 17:44:48 +02:00
parent 1bbe7702d3
commit 9b6f2b467a
2 changed files with 2 additions and 2 deletions

View file

@ -137,7 +137,7 @@ class ytpCommand extends Command {
if (err) { if (err) {
console.error(err.toString()); console.error(err.toString());
loadingmsg.delete(); loadingmsg.delete();
if (err.toString().includes('HTTP Error 429')) { if (err.toString().includes('HTTP Error 429') || err.toString().includes('HTTP Error 403')) {
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.'); 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 { } else {
return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?'); return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?');

View file

@ -76,7 +76,7 @@ class DownloadCommand extends Command {
if (err) { if (err) {
console.error(err.toString()); console.error(err.toString());
loadingmsg.delete(); loadingmsg.delete();
if (err.toString().includes('HTTP Error 429')) { if (err.toString().includes('HTTP Error 429') || err.toString().includes('HTTP Error 403')) {
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.'); 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 { } else {
return message.channel.send('An error has occured, I can\'t download from the link you provided.'); return message.channel.send('An error has occured, I can\'t download from the link you provided.');