فهرست منبع

[utils] Make restricted filenames ignore characters in Unicode categories Mark, Other

Resolves #32629
dirkf 1 سال پیش
والد
کامیت
427472351c
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      youtube_dl/utils.py

+ 2 - 1
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()):
         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