about summary refs log tree commit diff
path: root/youtube_dl/downloader
diff options
context:
space:
mode:
authorPratyush Singh <singh.pratyush96@gmail.com>2016-12-24 21:05:41 +0530
committerSergey M․ <dstftw@gmail.com>2017-02-25 20:59:04 +0700
commitd374d943f3d9eca4b2052cfc830905d299a0688a (patch)
treef7b30e5f3e481002f597ff1afc08741acdaeab1c /youtube_dl/downloader
parent103f8c8d36170d5cb489420db0e8fe383b1f93dc (diff)
downloadyoutube-dl-d374d943f3d9eca4b2052cfc830905d299a0688a.tar.gz
youtube-dl-d374d943f3d9eca4b2052cfc830905d299a0688a.tar.xz
youtube-dl-d374d943f3d9eca4b2052cfc830905d299a0688a.zip
[downloader/common] Limit displaying 2 digits after decimal point in sleep interval message
Diffstat (limited to 'youtube_dl/downloader')
-rw-r--r--youtube_dl/downloader/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/downloader/common.py b/youtube_dl/downloader/common.py
index 3dc144b4e..2c4470a95 100644
--- a/youtube_dl/downloader/common.py
+++ b/youtube_dl/downloader/common.py
@@ -347,7 +347,10 @@ class FileDownloader(object):
         if min_sleep_interval:
             max_sleep_interval = self.params.get('max_sleep_interval', min_sleep_interval)
             sleep_interval = random.uniform(min_sleep_interval, max_sleep_interval)
-            self.to_screen('[download] Sleeping %s seconds...' % sleep_interval)
+            self.to_screen(
+                '[download] Sleeping %s seconds...' % (
+                    int(sleep_interval) if sleep_interval.is_integer()
+                    else '%.2f' % sleep_interval))
             time.sleep(sleep_interval)
 
         return self.real_download(filename, info_dict)