mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 14:24:03 -07:00
Merge 02b05f25cc
into fe4d68e196
This commit is contained in:
commit
3af1080410
1 changed files with 12 additions and 1 deletions
|
@ -197,7 +197,18 @@ def sanitize_filename(s):
|
|||
if char in u' .\\/|?*<>:"' or ord(char) < 32:
|
||||
return '_'
|
||||
return char
|
||||
return u''.join(map(replace_insane, s)).strip('_')
|
||||
|
||||
if sys.platform == 'win32':
|
||||
s = s.replace(ur'/', u'%')
|
||||
s = re.sub(ur' *[:\|] *', u' - ', s)
|
||||
s = re.sub(ur'[/<>"\?\*]', u'', s)
|
||||
|
||||
s = u''.join(map(replace_insane, s)).strip('_')
|
||||
|
||||
if sys.platform == 'win32':
|
||||
s = s.replace(u'_', u' ');
|
||||
|
||||
return s
|
||||
|
||||
def orderedSet(iterable):
|
||||
""" Remove all duplicates from the input iterable """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue