projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
739674c
)
Allow hours in ETA display (Fixes #1280)
author
Philipp Hagemeister
<phihag@phihag.de>
Wed, 21 Aug 2013 03:44:19 +0000
(
05:44
+0200)
committer
Philipp Hagemeister
<phihag@phihag.de>
Wed, 21 Aug 2013 03:44:19 +0000
(
05:44
+0200)
youtube_dl/FileDownloader.py
patch
|
blob
|
history
diff --git
a/youtube_dl/FileDownloader.py
b/youtube_dl/FileDownloader.py
index ea6b9d626efa7a18eafe20afa8c473d1afee315b..217c4a52f5204ccf471ccb1932a2f322571828eb 100644
(file)
--- 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):