diff options
author | Pierre Rudloff <pierre@rudloff.pro> | 2013-08-22 12:52:05 +0200 |
---|---|---|
committer | Pierre Rudloff <pierre@rudloff.pro> | 2013-08-22 12:52:05 +0200 |
commit | 8d212e604a86da3c924ab15fe8045ab748a8183d (patch) | |
tree | 5bc5588e5bbe7f8dad3fb1d0bbba354f2fb9e90c /youtube_dl/FileDownloader.py | |
parent | 943f7f7a399c6fb3006eb2bd68070f28a272171f (diff) | |
parent | 063fcc9676718fc4395b92d6e9665e7f3e9c8156 (diff) |
Merge remote-tracking branch 'upstream/master'
Conflicts:
youtube_dl/extractor/jeuxvideo.py
Diffstat (limited to 'youtube_dl/FileDownloader.py')
-rw-r--r-- | youtube_dl/FileDownloader.py | 10 |
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): |