Compare commits

..

No commits in common. "d9bdf744fd7f480786cbb7f891769a3dc3e9356a" and "a07ec1f958f009f59deb7c8edbcd75b735be638f" have entirely different histories.

3 changed files with 16 additions and 12 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "twitch-vod-manager", "name": "twitch-vod-manager",
"version": "4.5.5", "version": "4.5.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "twitch-vod-manager", "name": "twitch-vod-manager",
"version": "4.5.5", "version": "4.5.4",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^1.6.0", "axios": "^1.6.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "twitch-vod-manager", "name": "twitch-vod-manager",
"version": "4.5.5", "version": "4.5.4",
"description": "Twitch VOD Manager - Download Twitch VODs easily", "description": "Twitch VOD Manager - Download Twitch VODs easily",
"main": "dist/main.js", "main": "dist/main.js",
"author": "xRangerDE", "author": "xRangerDE",

View File

@ -2203,7 +2203,6 @@ function downloadVODPart(
const args = [...streamlinkCmd.prefixArgs, url, 'best', '-o', filename, '--force']; const args = [...streamlinkCmd.prefixArgs, url, 'best', '-o', filename, '--force'];
let lastErrorLine = ''; let lastErrorLine = '';
const expectedDurationSeconds = parseClockDurationSeconds(endTime); const expectedDurationSeconds = parseClockDurationSeconds(endTime);
let lastStreamlinkPercent = 0;
if (startTime) { if (startTime) {
args.push('--hls-start-offset', startTime); args.push('--hls-start-offset', startTime);
@ -2251,13 +2250,19 @@ function downloadVODPart(
lastTime = now; lastTime = now;
let etaStr = ''; let etaStr = '';
if (downloadedBytes > 0) { if (speed > 0 && downloadedBytes > 0) {
const elapsedSec = (Date.now() - (itemTracking?.startTime || Date.now())) / 1000; const itemStartTime = itemTracking.startTime;
if (elapsedSec > 5 && lastStreamlinkPercent > 1) { const elapsedSec = (Date.now() - itemStartTime) / 1000;
// Use streamlink's reported progress for accurate ETA if (elapsedSec > 5) { // Wait at least 5 seconds before showing ETA
const remainingSec = (elapsedSec / lastStreamlinkPercent) * (100 - lastStreamlinkPercent); const avgSpeed = downloadedBytes / elapsedSec;
if (remainingSec > 0 && remainingSec < 86400) { if (expectedDurationSeconds && expectedDurationSeconds > 0) {
etaStr = formatETA(remainingSec); const estimatedTotalBytes = avgSpeed * expectedDurationSeconds;
if (estimatedTotalBytes > downloadedBytes) {
const remainingSec = (estimatedTotalBytes - downloadedBytes) / avgSpeed;
if (remainingSec > 0 && remainingSec < 86400) { // Between 0 and 24 hours
etaStr = formatETA(remainingSec);
}
}
} }
} }
} }
@ -2285,7 +2290,6 @@ function downloadVODPart(
const match = line.match(/(\d+\.\d+)%/); const match = line.match(/(\d+\.\d+)%/);
if (match) { if (match) {
const percent = parseFloat(match[1]); const percent = parseFloat(match[1]);
lastStreamlinkPercent = percent;
onProgress({ onProgress({
id: itemId, id: itemId,
progress: percent, progress: percent,