mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Update vld
This commit is contained in:
parent
d8eb4a6b86
commit
52ccf92f6e
@ -106,15 +106,17 @@ class Downloader {
|
||||
const promises = [];
|
||||
while (startByte < fragment.size) {
|
||||
const partFilename = `${title}.part${part}`;
|
||||
if (fs.existsSync(partFilename)) {
|
||||
this.progressMap.set(partFilename, partialLength);
|
||||
this.updateProgress();
|
||||
}
|
||||
else {
|
||||
const endByte = Math.min(fragment.size - 1, Math.round(startByte + partialLength));
|
||||
const range = `bytes=${startByte}-${endByte}`;
|
||||
promises.push(this.downloadFragmentPart(fragment.url, range, partFilename));
|
||||
}
|
||||
// if (fs.existsSync(partFilename))
|
||||
// {
|
||||
// this.progressMap.set(partFilename, partialLength);
|
||||
// this.updateProgress();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
const endByte = Math.min(fragment.size - 1, Math.round(startByte + partialLength));
|
||||
const range = `bytes=${startByte}-${endByte}`;
|
||||
promises.push(this.downloadFragmentPart(fragment.url, range, partFilename));
|
||||
// }
|
||||
startByte = Math.round(startByte + partialLength) + 1;
|
||||
part++;
|
||||
}
|
||||
|
||||
@ -152,17 +152,17 @@ class Downloader
|
||||
while (startByte < fragment.size)
|
||||
{
|
||||
const partFilename = `${title}.part${part}`;
|
||||
if (fs.existsSync(partFilename))
|
||||
{
|
||||
this.progressMap.set(partFilename, partialLength);
|
||||
this.updateProgress();
|
||||
}
|
||||
else
|
||||
{
|
||||
const endByte = Math.min(fragment.size - 1, Math.round(startByte + partialLength));
|
||||
const range = `bytes=${startByte}-${endByte}`;
|
||||
promises.push(this.downloadFragmentPart(fragment.url, range, partFilename));
|
||||
}
|
||||
// if (fs.existsSync(partFilename))
|
||||
// {
|
||||
// this.progressMap.set(partFilename, partialLength);
|
||||
// this.updateProgress();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
const endByte = Math.min(fragment.size - 1, Math.round(startByte + partialLength));
|
||||
const range = `bytes=${startByte}-${endByte}`;
|
||||
promises.push(this.downloadFragmentPart(fragment.url, range, partFilename));
|
||||
// }
|
||||
startByte = Math.round(startByte + partialLength) + 1;
|
||||
part++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user