From 28f9d994f5c241b7429cf456c29a50c1d31e42a0 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sat, 31 May 2025 09:24:12 -0700 Subject: [PATCH] optional --- src/ytdl_sub/plugins/throttle_protection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ytdl_sub/plugins/throttle_protection.py b/src/ytdl_sub/plugins/throttle_protection.py index 70c7122f..c48ab5ef 100644 --- a/src/ytdl_sub/plugins/throttle_protection.py +++ b/src/ytdl_sub/plugins/throttle_protection.py @@ -202,7 +202,9 @@ class ThrottleProtectionPlugin(Plugin[ThrottleProtectionOptions]): ) def ytdl_options(self) -> Optional[Dict]: - return {"sleep_interval_requests": self.plugin_options.sleep_per_request_s.max_value()} + if self.plugin_options.sleep_per_request_s is not None: + return {"sleep_interval_requests": self.plugin_options.sleep_per_request_s.max_value()} + return {} def initialize_subscription(self) -> bool: if self.plugin_options.subscription_download_probability: