mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-02-17 21:00:12 +00:00
[utils] Make restricted filenames ignore characters in Unicode categories Mark, Other
Resolves #32629
This commit is contained in:
parent
c6538ed323
commit
427472351c
1 changed files with 2 additions and 1 deletions
|
@ -2121,7 +2121,8 @@ def sanitize_filename(s, restricted=False, is_id=False):
|
||||||
if restricted and (char in '!&\'()[]{}$;`^,#' or char.isspace()):
|
if restricted and (char in '!&\'()[]{}$;`^,#' or char.isspace()):
|
||||||
return '_'
|
return '_'
|
||||||
if restricted and ord(char) > 127:
|
if restricted and ord(char) > 127:
|
||||||
return '_'
|
return '' if unicodedata.category(char)[0] in 'CM' else '_'
|
||||||
|
|
||||||
return char
|
return char
|
||||||
|
|
||||||
# Replace look-alike Unicode glyphs
|
# Replace look-alike Unicode glyphs
|
||||||
|
|
Loading…
Add table
Reference in a new issue