From 077a755f5e30039c90b22b3e901af047983062ba Mon Sep 17 00:00:00 2001 From: Inrixia Date: Sun, 26 Mar 2023 03:24:51 +1300 Subject: [PATCH] Fixed origin url being prefixed incorrectly & increased base retry delay --- src/Downloader.ts | 2 +- src/lib/Video.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Downloader.ts b/src/Downloader.ts index 7bbcce9..2842f83 100644 --- a/src/Downloader.ts +++ b/src/Downloader.ts @@ -184,7 +184,7 @@ export default class Downloader { this.log(formattedTitle, { message: `\u001b[31m\u001b[1mERR\u001b[0m: ${info.message} - Retrying in ${retries}s [${retries}/${MaxRetries}]` }, true); // Wait between retries - await sleep(1000 * retries); + await sleep(1000 * (retries + 1)); await this.processVideo(task, ++retries); } else this.log(formattedTitle, { message: `\u001b[31m\u001b[1mERR\u001b[0m: ${info.message} Max Retries! [${retries}/${MaxRetries}]` }, true); diff --git a/src/lib/Video.ts b/src/lib/Video.ts index ddaa18d..bf0f7d6 100644 --- a/src/lib/Video.ts +++ b/src/lib/Video.ts @@ -184,7 +184,7 @@ export default class Video { // Set the quality to use based on whats given in the settings.json or the highest available const downloadVariant = availableVariants.find((variant) => variant.label.includes(quality)) ?? availableVariants[0]; - const downloadRequest = fApi.got.stream(`https://${downloadOrigin.url}${downloadVariant.url}`, requestOptions); + const downloadRequest = fApi.got.stream(`${downloadOrigin.url}${downloadVariant.url}`, requestOptions); // Pipe the download to the file once response starts downloadRequest.pipe(createWriteStream(`${this.fullPath}${this.multiPartSuffix(i)}.partial`, writeStreamOptions)); // Set the videos expectedSize once we know how big it should be for download validation.