projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c6538ed
)
[utils] Make restricted filenames ignore characters in Unicode categories Mark, Other
author
dirkf
<fieldhouse@gmx.net>
Tue, 28 Nov 2023 17:26:37 +0000
(17:26 +0000)
committer
dirkf
<fieldhouse@gmx.net>
Wed, 29 Nov 2023 22:08:01 +0000
(22:08 +0000)
Resolves #32629
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 443d2609c96a6dcca7711e408bb83b7cfe05a972..61b94d84c44e54488bde08f30f53e6bf51be5b14 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-2121,7
+2121,8
@@
def sanitize_filename(s, restricted=False, is_id=False):
if restricted and (char in '!&\'()[]{}$;`^,#' or char.isspace()):
return '_'
if restricted and ord(char) > 127:
- return '_'
+ return '' if unicodedata.category(char)[0] in 'CM' else '_'
+
return char
# Replace look-alike Unicode glyphs