mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 12:01:28 +00:00
Remove exclamation mark in --restrict-filenames mode
This commit is contained in:
parent
33d94a6c99
commit
dffe658bac
|
@ -56,7 +56,7 @@ def test_sanitize_filename_restricted(self):
|
||||||
self.assertEqual(sanitize_filename(u'aäb中国的c', restricted=True), u'a_b_c')
|
self.assertEqual(sanitize_filename(u'aäb中国的c', restricted=True), u'a_b_c')
|
||||||
self.assertTrue(sanitize_filename(u'ö', restricted=True) != u'') # No empty filename
|
self.assertTrue(sanitize_filename(u'ö', restricted=True) != u'') # No empty filename
|
||||||
|
|
||||||
forbidden = u'"\0\\/&: \'\t\n'
|
forbidden = u'"\0\\/&!: \'\t\n'
|
||||||
for fc in forbidden:
|
for fc in forbidden:
|
||||||
for fbc in forbidden:
|
for fbc in forbidden:
|
||||||
self.assertTrue(fbc not in sanitize_filename(fc, restricted=True))
|
self.assertTrue(fbc not in sanitize_filename(fc, restricted=True))
|
||||||
|
|
|
@ -208,7 +208,7 @@ def replace_insane(char):
|
||||||
return '_-' if restricted else ' -'
|
return '_-' if restricted else ' -'
|
||||||
elif char in '\\/|*<>':
|
elif char in '\\/|*<>':
|
||||||
return '_'
|
return '_'
|
||||||
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 '_'
|
||||||
|
|
Loading…
Reference in a new issue