mirror of
https://github.com/Tusko/vimeo-private-downloader.git
synced 2025-08-24 07:05:55 -07:00
wait for segment request timeout and auto download retry
This commit is contained in:
parent
10f453e0e8
commit
6f7894a242
1 changed files with 29 additions and 25 deletions
|
@ -107,7 +107,7 @@ function combineSegments(type, i, segmentsUrl, output, filename, downloadingFlag
|
||||||
`Downloading ${type} segment ${i}/${segmentsUrl.length} of ${filename}`
|
`Downloading ${type} segment ${i}/${segmentsUrl.length} of ${filename}`
|
||||||
);
|
);
|
||||||
|
|
||||||
https
|
let req = https
|
||||||
.get(segmentsUrl[i], res => {
|
.get(segmentsUrl[i], res => {
|
||||||
res.on("data", d => output.write(d));
|
res.on("data", d => output.write(d));
|
||||||
|
|
||||||
|
@ -118,6 +118,10 @@ function combineSegments(type, i, segmentsUrl, output, filename, downloadingFlag
|
||||||
.on("error", e => {
|
.on("error", e => {
|
||||||
cb(e);
|
cb(e);
|
||||||
});
|
});
|
||||||
|
req.setTimeout(7000, function () {
|
||||||
|
console.log("Timeout. Retrying");
|
||||||
|
combineSegments(type, i, segmentsUrl, output, filename, downloadingFlag, cb)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getJson(url, cb) {
|
function getJson(url, cb) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue