diff options
author | singh-pratyush96 <singh.pratyush96@gmail.com> | 2016-08-04 15:47:22 +0530 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-08-09 03:32:42 +0700 |
commit | 065bc354894f1d35592529455d9eb685470124b9 (patch) | |
tree | ea4686d4649cac08f87a4980b4a8a645f431545a /youtube_dl/__init__.py | |
parent | 3a380766d1d6abd83213319b41cdf9a18977a69c (diff) |
Add --max-sleep-interval (Closes #9930)
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r-- | youtube_dl/__init__.py | 7 |
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, |