🐎 Continue curl download where it left off
This commit is contained in:
parent
4f70c05567
commit
43d4019860
1 changed files with 2 additions and 2 deletions
|
@ -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}.`);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue