From 07ff290dce6713a80e4fe92fcf24cb23d07c5ce6 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 10 Mar 2022 11:38:34 +0530 Subject: [PATCH] Fix `--sleep-interval` Bug in d1b5f70bc9f9dcda1544b88b42ecc25f7f7aa1c7 Closes #3012 --- yt_dlp/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 0fc517b99..2408d4129 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -198,10 +198,13 @@ def validate_minmax(min_val, max_val, min_name, max_name=None): validate_positive('requests sleep interval', opts.sleep_interval_requests) validate_positive('sleep interval', opts.sleep_interval) validate_positive('max sleep interval', opts.max_sleep_interval) - if opts.max_sleep_interval is not None: + if opts.sleep_interval is None: validate( - opts.sleep_interval is not None, 'min sleep interval', + opts.max_sleep_interval is None, 'min sleep interval', msg='{name} must be specified; use --min-sleep-interval') + elif opts.max_sleep_interval is None: + opts.max_sleep_interval = opts.sleep_interval + else: validate_minmax(opts.sleep_interval, opts.max_sleep_interval, 'sleep interval') if opts.wait_for_video is not None: