undo file identation changes

This commit is contained in:
Felipe Andrada 2020-11-30 01:54:14 -03:00
commit 85db8c5885

View file

@ -107,7 +107,7 @@ log(
`Downloading ${type} segment ${i}/${segmentsUrl.length} of ${filename}` `Downloading ${type} segment ${i}/${segmentsUrl.length} of ${filename}`
); );
let req = https https
.get(segmentsUrl[i], res => { .get(segmentsUrl[i], res => {
res.on("data", d => output.write(d)); res.on("data", d => output.write(d));
@ -118,16 +118,12 @@ let req = https
.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) {
let data = ""; let data = "";
https let req = https
.get(url, res => { .get(url, res => {
res.on("data", d => (data += d)); res.on("data", d => (data += d));
@ -136,6 +132,11 @@ function getJson(url, cb) {
.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 initJs(n = 0) { function initJs(n = 0) {