aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/FileDownloader.py
diff options
context:
space:
mode:
authorAllan Zhou <allanzp@gmail.com>2013-08-21 00:07:03 -0700
committerAllan Zhou <allanzp@gmail.com>2013-08-21 00:07:03 -0700
commita3f62b8255120acda6d429d2a3ce53b13e871c5d (patch)
tree6a1a8707369cd36654be4ef1deb044a1fcce01ba /youtube_dl/FileDownloader.py
parent37b6d5f684d409365bbac6d3f2b8074b57e643a8 (diff)
parent6c3e6e88d3aaaea64ca3d96c005da654c89c8a3a (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'youtube_dl/FileDownloader.py')
-rw-r--r--youtube_dl/FileDownloader.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py
index ea6b9d626..217c4a52f 100644
--- a/youtube_dl/FileDownloader.py
+++ b/youtube_dl/FileDownloader.py
@@ -79,9 +79,13 @@ class FileDownloader(object):
rate = float(current) / dif
eta = int((float(total) - float(current)) / rate)
(eta_mins, eta_secs) = divmod(eta, 60)
- if eta_mins > 99:
- return '--:--'
- return '%02d:%02d' % (eta_mins, eta_secs)
+ (eta_hours, eta_mins) = divmod(eta_mins, 60)
+ if eta_hours > 99:
+ return '--:--:--'
+ if eta_hours == 0:
+ return '%02d:%02d' % (eta_mins, eta_secs)
+ else:
+ return '%02d:%02d:%02d' % (eta_hours, eta_mins, eta_secs)
@staticmethod
def calc_speed(start, now, bytes):