mirror of
https://github.com/Tusko/vimeo-private-downloader.git
synced 2025-08-21 05:44:04 -07:00
Feature identify, after a restart, if last downloaded file is complete, if it's not the download is restarted
This commit is contained in:
parent
c5b0599301
commit
7c20a113d4
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ function loadVideo(num, cb) {
|
|||
|
||||
function processFile(type, baseUrl, initData, segments, filename, cb) {
|
||||
const filePath = `./parts/${filename}`;
|
||||
const downloadingFlag = `./parts/.${filename}~`
|
||||
const downloadingFlag = `./parts/.${filename}~`;
|
||||
|
||||
if(fs.existsSync(downloadingFlag)) {
|
||||
log("⚠️", ` ${filename} - ${type} is incomplete, restarting the download`);
|
||||
|
@ -112,7 +112,7 @@ function combineSegments(type, i, segmentsUrl, output, filename, downloadingFlag
|
|||
res.on("data", d => output.write(d));
|
||||
|
||||
res.on("end", () =>
|
||||
combineSegments(type, i + 1, segmentsUrl, output, filename, cb)
|
||||
combineSegments(type, i + 1, segmentsUrl, output, filename, downloadingFlag, cb)
|
||||
);
|
||||
})
|
||||
.on("error", e => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue