Merge 25903f82c8d123ec2a22ae36ee7015a694bc2420 into 2b4fbfce25902d557b86b003cf48f738129efce4

This commit is contained in:
dirkf 2025-03-26 07:44:35 +00:00 committed by GitHub
commit 72bb0e1865
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1762,7 +1762,9 @@ class YoutubeDL(object):
format['format_id'] = compat_str(i)
else:
# Sanitize format_id from characters used in format selector expression
format['format_id'] = re.sub(r'[\s,/+\[\]()]', '_', format['format_id'])
# In fact, replace anything that's not allowed as a value in format selection,
# or (eg) excluding a format_id can crash. See method _build_format_filter()
format['format_id'] = re.sub(r'[^a-zA-Z0-9._-]', '_', format['format_id'])
format_id = format['format_id']
if format_id not in formats_dict:
formats_dict[format_id] = []