Add --max-sleep-interval (Closes #9930)

This commit is contained in:
singh-pratyush96 2016-08-04 15:47:22 +05:30 committed by Sergey M․
parent 3a380766d1
commit 065bc35489
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
4 changed files with 27 additions and 5 deletions

View file

@ -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,