From 47dc8617271c2589e5c37bd78b48b859d4571d5c Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Thu, 14 Aug 2025 19:56:31 -0700 Subject: [PATCH] [BACKEND]: Less finger-printable request delay in throttle protection (#1273) Thanks @rpatterson for the fix! --------- Following [discussion about the previous preset delay](https://discord.com/channels/994270357957648404/994270357957648408/1405705039649046589), we weren't able to find a reason for it and there was agreement that the example value from yt-dlp is more sensible. While we're at it, also set a default `min:` value that would probably be sensible if it were to be used in the future. Finally, capture the reasoning behind the new preset values in comments to make the reference documentation more helpful to new users in the future. --- .../helpers/throttle_protection.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml b/src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml index 81264d69..f9c6b93a 100644 --- a/src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml +++ b/src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml @@ -14,8 +14,15 @@ presets: ) } sleep_per_request_s: - min: 3.5 - max: 3.5 + # yt-dlp processes eath request synchronously, so it's intrinsic delay between + # requests already represent a maximum close to real app/client behavior in the + # field. Add a small additional margin matching the example values from yt-dlp + # to be conservative: + max: 0.75 + # Not used at time of writing, but choose a value that would mimic real + # app/client behavior in the field. The next request is usually sent right away + # if processing the previous request is done asynchronously: + min: 0.0 sleep_per_download_s: min: 13.8 max: 28.4 @@ -23,4 +30,4 @@ presets: min: 16.3 max: 26.1 overrides: - enable_throttle_protection: True \ No newline at end of file + enable_throttle_protection: True