mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-07-22 17:37:16 +00:00
Fix allow-unsafe-ext compat option (#16920)
Fix bug in e578e265f7
Closes #16919
Authored by: bashonly
This commit is contained in:
@@ -5218,12 +5218,17 @@ class _UnsafeExtensionError(Exception):
|
||||
'sbv',
|
||||
])
|
||||
|
||||
_enabled = True
|
||||
|
||||
def __init__(self, extension, /):
|
||||
super().__init__(f'unsafe file extension: {extension!r}')
|
||||
self.extension = extension
|
||||
|
||||
@classmethod
|
||||
def sanitize_extension(cls, extension, /, *, prepend=False, _allowed_exts=()):
|
||||
if not cls._enabled:
|
||||
return extension
|
||||
|
||||
if extension is None:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user