mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-11 03:09:35 +00:00
@@ -87,6 +87,7 @@ from .utils import (
|
||||
MaxDownloadsReached,
|
||||
merge_headers,
|
||||
network_exceptions,
|
||||
NO_DEFAULT,
|
||||
number_of_digits,
|
||||
orderedSet,
|
||||
OUTTMPL_TYPES,
|
||||
@@ -1150,8 +1151,10 @@ class YoutubeDL(object):
|
||||
na = self.params.get('outtmpl_na_placeholder', 'NA')
|
||||
|
||||
def filename_sanitizer(key, value, restricted=self.params.get('restrictfilenames')):
|
||||
return sanitize_filename(str(value), restricted=restricted,
|
||||
is_id=re.search(r'(^|[_.])id(\.|$)', key))
|
||||
return sanitize_filename(str(value), restricted=restricted, is_id=(
|
||||
bool(re.search(r'(^|[_.])id(\.|$)', key))
|
||||
if 'filename-sanitization' in self.params.get('compat_opts', [])
|
||||
else NO_DEFAULT))
|
||||
|
||||
sanitizer = sanitize if callable(sanitize) else filename_sanitizer
|
||||
sanitize = bool(sanitize)
|
||||
|
Reference in New Issue
Block a user