Merge pull request #1017 from tcely/patch-3
Some checks failed
CI / info (push) Has been cancelled
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / containerise (push) Has been cancelled

Let `missing_pot` formats download after testing
This commit is contained in:
meeb 2025-05-10 15:46:12 +10:00 committed by GitHub
commit cb36f44235
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -359,6 +359,7 @@ def download_media(
'sleep_interval': 10,
'max_sleep_interval': min(20*60, max(60, settings.DOWNLOAD_MEDIA_DELAY)),
'sleep_interval_requests': 1 + (2 * settings.BACKGROUND_TASK_ASYNC_THREADS),
'extractor_args': opts.get('extractor_args', dict()),
'paths': opts.get('paths', dict()),
'postprocessor_args': opts.get('postprocessor_args', dict()),
'postprocessor_hooks': opts.get('postprocessor_hooks', list()),
@ -382,6 +383,18 @@ def download_media(
'temp': str(temp_dir_path),
})
# Allow download of formats that tested good with 'missing_pot'
youtube_ea_dict = ytopts['extractor_args'].get('youtube', dict())
formats_list = youtube_ea_dict.get('formats', list())
if 'missing_pot' not in formats_list:
formats_list += ('missing_pot',)
youtube_ea_dict.update({
'formats': formats_list,
})
ytopts['extractor_args'].update({
'youtube': youtube_ea_dict,
})
postprocessor_hook_func = postprocessor_hook.get('function', None)
if postprocessor_hook_func:
ytopts['postprocessor_hooks'].append(postprocessor_hook_func)