Skip to content

Commit

Permalink
[utils] Make restricted filenames ignore characters in Unicode catego…
Browse files Browse the repository at this point in the history
…ries Mark, Other

Resolves #32629
  • Loading branch information
dirkf committed Nov 29, 2023
1 parent c6538ed commit 4274723
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion youtube_dl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,8 @@ def replace_insane(char):
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
Expand Down

0 comments on commit 4274723

Please sign in to comment.