1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-24 14:22:53 +08:00

[common] Made sleep interval log more readable

This commit is contained in:
Pratyush Singh 2016-12-24 21:05:41 +05:30
parent 264e77c406
commit 0efd6dffea

View File

@ -347,7 +347,9 @@ 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)
interval_display = int(sleep_interval) if sleep_interval == int(sleep_interval)\
else ('%.2f' % sleep_interval)
self.to_screen('[download] Sleeping %s seconds...' % interval_display)
time.sleep(sleep_interval)
return self.real_download(filename, info_dict)