浏览代码

[downloader] Fix baa6c5e: show ETA of http download as ETA instead of total d/l time

dirkf 1 年之前
父节点
当前提交
00ef748cc0
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      youtube_dl/downloader/common.py
  2. 1 1
      youtube_dl/downloader/http.py

+ 1 - 1
youtube_dl/downloader/common.py

@@ -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:

+ 1 - 1
youtube_dl/downloader/http.py

@@ -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',