From 41c65354b96e73d70dde84fe852d61a4b2e47175 Mon Sep 17 00:00:00 2001 From: supositware Date: Fri, 17 Sep 2021 20:18:34 +0200 Subject: [PATCH] fix proxy --- commands/utility/download.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands/utility/download.js b/commands/utility/download.js index fea059c1..8e61a5f6 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -113,6 +113,11 @@ class DownloadCommand extends Command { Embed.setFooter(`Using Hapi | ${Embed.footer.text}`); compressEmbed.setFooter(`Using Hapi | ${compressEmbed.footer.text}`); + if (args.proxy && !args.proxyAuto) { // args.proxyAuto is only provided when the command is run after a error 429 + args.proxy = args.proxy - 1; + if (!proxy[args.proxy]) args.proxy = 0; + } + const params = new URLSearchParams(); params.append('url', args.link.href); if (proxy[args.proxy] !== undefined) {