mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-01-18 23:03:05 +01:00
Correct ETA after resume
This commit is contained in:
parent
e43bc2bb01
commit
d3feb430ef
1 changed files with 5 additions and 1 deletions
|
@ -62,6 +62,10 @@ class HttpFD(FileDownloader):
|
||||||
|
|
||||||
ctx.is_resume = ctx.resume_len > 0
|
ctx.is_resume = ctx.resume_len > 0
|
||||||
|
|
||||||
|
ctx.start_len = 0
|
||||||
|
if ctx.is_resume:
|
||||||
|
ctx.start_len = ctx.resume_len
|
||||||
|
|
||||||
class SucceedDownload(Exception):
|
class SucceedDownload(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -300,7 +304,7 @@ class HttpFD(FileDownloader):
|
||||||
if ctx.data_len is None:
|
if ctx.data_len is None:
|
||||||
eta = None
|
eta = None
|
||||||
else:
|
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({
|
self._hook_progress({
|
||||||
'status': 'downloading',
|
'status': 'downloading',
|
||||||
|
|
Loading…
Add table
Reference in a new issue