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 = [];
|
const promises = [];
|
||||||
while (startByte < fragment.size) {
|
while (startByte < fragment.size) {
|
||||||
const partFilename = `${title}.part${part}`;
|
const partFilename = `${title}.part${part}`;
|
||||||
if (fs.existsSync(partFilename)) {
|
// if (fs.existsSync(partFilename))
|
||||||
this.progressMap.set(partFilename, partialLength);
|
// {
|
||||||
this.updateProgress();
|
// this.progressMap.set(partFilename, partialLength);
|
||||||
}
|
// this.updateProgress();
|
||||||
else {
|
// }
|
||||||
const endByte = Math.min(fragment.size - 1, Math.round(startByte + partialLength));
|
// else
|
||||||
const range = `bytes=${startByte}-${endByte}`;
|
// {
|
||||||
promises.push(this.downloadFragmentPart(fragment.url, range, partFilename));
|
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;
|
startByte = Math.round(startByte + partialLength) + 1;
|
||||||
part++;
|
part++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,17 +152,17 @@ class Downloader
|
|||||||
while (startByte < fragment.size)
|
while (startByte < fragment.size)
|
||||||
{
|
{
|
||||||
const partFilename = `${title}.part${part}`;
|
const partFilename = `${title}.part${part}`;
|
||||||
if (fs.existsSync(partFilename))
|
// if (fs.existsSync(partFilename))
|
||||||
{
|
// {
|
||||||
this.progressMap.set(partFilename, partialLength);
|
// this.progressMap.set(partFilename, partialLength);
|
||||||
this.updateProgress();
|
// this.updateProgress();
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
const endByte = Math.min(fragment.size - 1, Math.round(startByte + partialLength));
|
const endByte = Math.min(fragment.size - 1, Math.round(startByte + partialLength));
|
||||||
const range = `bytes=${startByte}-${endByte}`;
|
const range = `bytes=${startByte}-${endByte}`;
|
||||||
promises.push(this.downloadFragmentPart(fragment.url, range, partFilename));
|
promises.push(this.downloadFragmentPart(fragment.url, range, partFilename));
|
||||||
}
|
// }
|
||||||
startByte = Math.round(startByte + partialLength) + 1;
|
startByte = Math.round(startByte + partialLength) + 1;
|
||||||
part++;
|
part++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user