forked from DRMTalks/devine
Remove Smart/Fancy Left/Right Quotation Marks from Filename Sanitizer
This commit is contained in:
parent
8df04de1ea
commit
301c026ca9
|
@ -111,7 +111,7 @@ def sanitize_filename(filename: str, spacer: str = ".") -> str:
|
|||
replace("/", " & ").\
|
||||
replace(";", " & ") # e.g. multi-episode filenames
|
||||
filename = re.sub(r"[:; ]", spacer, filename) # structural chars to (spacer)
|
||||
filename = re.sub(r"[\\*!?¿,'\"()<>|$#]", "", filename) # not filename safe chars
|
||||
filename = re.sub(r"[\\*!?¿,'\"“”()<>|$#]", "", filename) # not filename safe chars
|
||||
filename = re.sub(rf"[{spacer}]{{2,}}", spacer, filename) # remove extra neighbouring (spacer)s
|
||||
|
||||
return filename
|
||||
|
|
Loading…
Reference in New Issue