aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r--youtube_dl/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 2b34bf9c2..86af18d33 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -145,6 +145,12 @@ def _real_main(argv=None):
if numeric_limit is None:
parser.error('invalid max_filesize specified')
opts.max_filesize = numeric_limit
+ if opts.sleep_interval is not None:
+ if opts.sleep_interval < 0:
+ parser.error('sleep interval should not be negative')
+ elif opts.max_sleep_interval is not None:
+ if opts.max_sleep_interval < opts.sleep_interval:
+ parser.error('max sleep interval should not be less than sleep interval')
def parse_retries(retries):
if retries in ('inf', 'infinite'):
@@ -370,6 +376,7 @@ def _real_main(argv=None):
'source_address': opts.source_address,
'call_home': opts.call_home,
'sleep_interval': opts.sleep_interval,
+ 'max_sleep_interval': opts.max_sleep_interval,
'external_downloader': opts.external_downloader,
'list_thumbnails': opts.list_thumbnails,
'playlist_items': opts.playlist_items,