Restrict delays to a range between 10 seconds and 20 minutes

This commit is contained in:
tcely 2025-04-01 01:33:00 -04:00 committed by GitHub
parent 958604d8a3
commit 2a3df669c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -316,8 +316,8 @@ def download_media(
'check_formats': None,
'overwrites': None,
'skip_unavailable_fragments': False,
'sleep_interval': 10 + int(settings.DOWNLOAD_MEDIA_DELAY / 20),
'max_sleep_interval': settings.DOWNLOAD_MEDIA_DELAY,
'sleep_interval': max(10, int(settings.DOWNLOAD_MEDIA_DELAY / 20)),
'max_sleep_interval': min(20*60, max(60, settings.DOWNLOAD_MEDIA_DELAY)),
'sleep_interval_requests': 1 + (2 * settings.BACKGROUND_TASK_ASYNC_THREADS),
'paths': opts.get('paths', dict()),
'postprocessor_args': opts.get('postprocessor_args', dict()),