diff --git a/src/cdn/downloadWithCurl.ts b/src/cdn/downloadWithCurl.ts index ffa9dee..c425411 100644 --- a/src/cdn/downloadWithCurl.ts +++ b/src/cdn/downloadWithCurl.ts @@ -16,7 +16,7 @@ export default function downloadWithCurl({ host, path, tempFileName }: {host: st const url = `http://${host}${(path[0] === '/' ? '' : '/')}${path}`; const parameters: string[] = [ - //... + '--continue-at', '-', '--silent', '--limit-rate', `${MAXIMUM_SPEED}m`, '--speed-limit', String(MINIMUM_SPEED * 1024 * 1024), @@ -36,7 +36,7 @@ export default function downloadWithCurl({ host, path, tempFileName }: {host: st if (code === 0) { resolve(tempFileName); } else if (code === 28) { - reject(`Download speed too slow, restarting "${path.includes('/') ? path.substr(path.lastIndexOf('/')) : path}".`); + reject(`Download speed too slow, restarting "${path.includes('/') ? path.substr(path.lastIndexOf('/') + 1) : path}".`); } else { reject(`Error in process:\n> curl ${parameters.join(' ')}\nNon-zero exit code ${code}.`); }