Skip to content

Commit 47dc861

Browse files
authored
[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.
1 parent 2f55326 commit 47dc861

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ presets:
1414
)
1515
}
1616
sleep_per_request_s:
17-
min: 3.5
18-
max: 3.5
17+
# yt-dlp processes eath request synchronously, so it's intrinsic delay between
18+
# requests already represent a maximum close to real app/client behavior in the
19+
# field. Add a small additional margin matching the example values from yt-dlp
20+
# to be conservative:
21+
max: 0.75
22+
# Not used at time of writing, but choose a value that would mimic real
23+
# app/client behavior in the field. The next request is usually sent right away
24+
# if processing the previous request is done asynchronously:
25+
min: 0.0
1926
sleep_per_download_s:
2027
min: 13.8
2128
max: 28.4
2229
sleep_per_subscription_s:
2330
min: 16.3
2431
max: 26.1
2532
overrides:
26-
enable_throttle_protection: True
33+
enable_throttle_protection: True

0 commit comments

Comments
 (0)