aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/__init__.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-02-27 18:11:23 +0530
committerpukkandan <pukkandan@gmail.com>2021-02-27 18:14:42 +0530
commit1cf376f55a3d9335eb161c07c439ca143d86924e (patch)
treea8f6baa18140e4fa24cd084572b3c38f2cb3aa08 /yt_dlp/__init__.py
parent7f7de7f94dfeacb0eb78cb9487dfcaf5707da381 (diff)
Add option `--sleep-requests` to sleep b/w requests (Closes #106)
* Also fix documentation of `sleep_interval_subtitles` Related issues: https://github.com/blackjack4494/yt-dlc/issues/158 https://github.com/blackjack4494/youtube-dlc/issues/195 https://github.com/ytdl-org/youtube-dl/pull/28270 https://github.com/ytdl-org/youtube-dl/pull/28144 https://github.com/ytdl-org/youtube-dl/issues/27767 https://github.com/ytdl-org/youtube-dl/issues/23638 https://github.com/ytdl-org/youtube-dl/issues/26287 https://github.com/ytdl-org/youtube-dl/issues/26319
Diffstat (limited to 'yt_dlp/__init__.py')
-rw-r--r--yt_dlp/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py
index 91539daaf..15605ab31 100644
--- a/yt_dlp/__init__.py
+++ b/yt_dlp/__init__.py
@@ -169,6 +169,12 @@ def _real_main(argv=None):
parser.error('max sleep interval must be greater than or equal to min sleep interval')
else:
opts.max_sleep_interval = opts.sleep_interval
+ if opts.sleep_interval_subtitles is not None:
+ if opts.sleep_interval_subtitles < 0:
+ parser.error('subtitles sleep interval must be positive or 0')
+ if opts.sleep_interval_requests is not None:
+ if opts.sleep_interval_requests < 0:
+ parser.error('requests sleep interval must be positive or 0')
if opts.ap_mso and opts.ap_mso not in MSO_INFO:
parser.error('Unsupported TV Provider, use --ap-list-mso to get a list of supported TV Providers')
if opts.overwrites:
@@ -524,6 +530,7 @@ def _real_main(argv=None):
'fixup': opts.fixup,
'source_address': opts.source_address,
'call_home': opts.call_home,
+ 'sleep_interval_requests': opts.sleep_interval_requests,
'sleep_interval': opts.sleep_interval,
'max_sleep_interval': opts.max_sleep_interval,
'sleep_interval_subtitles': opts.sleep_interval_subtitles,