Skip to content

Commit

Permalink
Fixed origin url being prefixed incorrectly & increased base retry delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Mar 25, 2023
1 parent bc29eb4 commit 077a755
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 077a755

Please sign in to comment.