[downloader] Fix baa6c5e: show ETA of http download as ETA instead of total d/l time
authordirkf <fieldhouse@gmx.net>
Sun, 24 Sep 2023 21:00:13 +0000 (22:00 +0100)
committerdirkf <fieldhouse@gmx.net>
Sun, 24 Sep 2023 21:07:47 +0000 (22:07 +0100)
youtube_dl/downloader/common.py
youtube_dl/downloader/http.py

index afb4ee33dd3f597d7b4725ed16b4b261d98c41aa..91e691776b1d15adebe87acb3207680a2a771dfd 100644 (file)
@@ -96,7 +96,7 @@ class FileDownloader(object):
                 return None
             return int(float(remaining) / rate)
         start, now = (start_or_rate, now_or_remaining)
-        total, current = args
+        total, current = args[:2]
         if total is None:
             return None
         if now is None:
index 28a49b9e894fbedd99d382d52c9383b7514e9113..3cad8742091e8ecfe03a5ef0a7b160d4dc5d48d6 100644 (file)
@@ -294,7 +294,7 @@ class HttpFD(FileDownloader):
 
                 # Progress message
                 speed = self.calc_speed(start, now, byte_counter - ctx.resume_len)
-                eta = self.calc_eta(speed, ctx.data_len and (ctx.data_len - ctx.resume_len))
+                eta = self.calc_eta(speed, ctx.data_len and (ctx.data_len - byte_counter))
 
                 self._hook_progress({
                     'status': 'downloading',