From e43bc2bb0105171b3bd38cbd7c552ffe1f0d6883 Mon Sep 17 00:00:00 2001 From: 8street Date: Mon, 6 Jan 2025 15:36:25 +0300 Subject: [PATCH 1/2] Correct ETA --- yt_dlp/downloader/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/downloader/http.py b/yt_dlp/downloader/http.py index 9c6dd8b799..dfe86d159b 100644 --- a/yt_dlp/downloader/http.py +++ b/yt_dlp/downloader/http.py @@ -300,7 +300,7 @@ class HttpFD(FileDownloader): if ctx.data_len is None: eta = None else: - eta = self.calc_eta(start, time.time(), ctx.data_len - ctx.resume_len, byte_counter - ctx.resume_len) + eta = self.calc_eta(ctx.start_time, time.time(), ctx.data_len, byte_counter) self._hook_progress({ 'status': 'downloading', From d3feb430effc416a6d64445e9a74f4b0c65e48cc Mon Sep 17 00:00:00 2001 From: 8street Date: Mon, 6 Jan 2025 16:19:08 +0300 Subject: [PATCH 2/2] Correct ETA after resume --- yt_dlp/downloader/http.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yt_dlp/downloader/http.py b/yt_dlp/downloader/http.py index dfe86d159b..3edd7b760c 100644 --- a/yt_dlp/downloader/http.py +++ b/yt_dlp/downloader/http.py @@ -62,6 +62,10 @@ class HttpFD(FileDownloader): ctx.is_resume = ctx.resume_len > 0 + ctx.start_len = 0 + if ctx.is_resume: + ctx.start_len = ctx.resume_len + class SucceedDownload(Exception): pass @@ -300,7 +304,7 @@ class HttpFD(FileDownloader): if ctx.data_len is None: eta = None else: - eta = self.calc_eta(ctx.start_time, time.time(), ctx.data_len, byte_counter) + eta = self.calc_eta(ctx.start_time, time.time(), ctx.data_len - ctx.start_len, byte_counter - ctx.start_len) self._hook_progress({ 'status': 'downloading',