This commit is contained in:
Jesse Bannon 2023-11-04 22:55:07 -07:00
parent a932dad87b
commit 3399f7d591
2 changed files with 22 additions and 13 deletions

View file

@ -252,6 +252,14 @@ subtitles
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
throttle_protection
'''''''''''''''''''
.. autoclass:: ytdl_sub.plugins.throttle_protection.ThrottleProtectionOptions()
:members:
:member-order: bysource
-------------------------------------------------------------------------------
video_tags video_tags
'''''''''' ''''''''''
.. autoclass:: ytdl_sub.plugins.video_tags.VideoTagsOptions() .. autoclass:: ytdl_sub.plugins.video_tags.VideoTagsOptions()

View file

@ -61,8 +61,9 @@ class RandomizedRangeValidator(StrictDictValidator):
class ThrottleProtectionOptions(OptionsDictValidator): class ThrottleProtectionOptions(OptionsDictValidator):
""" """
Provides options to make ytdl-sub look more 'human-like'. For range-based values, Provides options to make ytdl-sub look more 'human-like' to protect from throttling. For
a random number will be chosen within the range to avoid sleeps looking scripted. range-based values, a random number will be chosen within the range to avoid sleeps looking
scripted.
Usage: Usage:
@ -71,11 +72,11 @@ class ThrottleProtectionOptions(OptionsDictValidator):
presets: presets:
my_example_preset: my_example_preset:
sleep_per_download_s: sleep_per_download_s:
min: 2 min: 2.2
max: 10 max: 10.8
sleep_per_subscription_s: sleep_per_subscription_s:
min: 9 min: 9.0
max: 14 max: 14.1
max_downloads_per_subscription: max_downloads_per_subscription:
min: 10 min: 10
max: 36 max: 36
@ -108,31 +109,31 @@ class ThrottleProtectionOptions(OptionsDictValidator):
@property @property
def sleep_per_download_s(self) -> Optional[RandomizedRangeValidator]: def sleep_per_download_s(self) -> Optional[RandomizedRangeValidator]:
""" """
Range in seconds to sleep between each download. Does not include time it takes for ytdl-sub Number in seconds to sleep between each download. Does not include time it takes for
to perform post-processing. ytdl-sub to perform post-processing.
""" """
return self._sleep_per_download_s return self._sleep_per_download_s
@property @property
def sleep_per_subscription_s(self) -> Optional[RandomizedRangeValidator]: def sleep_per_subscription_s(self) -> Optional[RandomizedRangeValidator]:
""" """
Range in seconds to sleep between each subscription. Number in seconds to sleep between each subscription.
""" """
return self._sleep_per_subscription_s return self._sleep_per_subscription_s
@property @property
def max_downloads_per_subscription(self) -> Optional[RandomizedRangeValidator]: def max_downloads_per_subscription(self) -> Optional[RandomizedRangeValidator]:
""" """
Range of downloads to perform per subscription. Number of downloads to perform per subscription.
""" """
return self._max_downloads_per_subscription return self._max_downloads_per_subscription
@property @property
def subscription_download_probability(self) -> Optional[ProbabilityValidator]: def subscription_download_probability(self) -> Optional[ProbabilityValidator]:
""" """
Probability to perform any downloads for each subscription. This is only recommended to Probability to perform any downloads, recomputed for each subscription. This is only
set if you run ytdl-sub in a cron-job, that way you are statistically guaranteed over time recommended to set if you run ytdl-sub in a cron-job, that way you are statistically
to eventually download the subscription. guaranteed over time to eventually download the subscription.
""" """
return self._subscription_download_probability return self._subscription_download_probability