mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 00:33:58 +03:00
removed a filename of the first letter is a period on unix system
This commit is contained in:
parent
f1ed97c500
commit
3966bcf9cb
@ -106,11 +106,7 @@ def filenameable(text):
|
|||||||
0: None,
|
0: None,
|
||||||
ord('/'): '-',
|
ord('/'): '-',
|
||||||
})
|
})
|
||||||
if platform.system() == 'Darwin': # For Mac OS
|
if platform.system() == 'Windows': # For Windows
|
||||||
text = text.translate({
|
|
||||||
ord(':'): '-',
|
|
||||||
})
|
|
||||||
elif platform.system() == 'Windows': # For Windows
|
|
||||||
text = text.translate({
|
text = text.translate({
|
||||||
ord(':'): '-',
|
ord(':'): '-',
|
||||||
ord('*'): '-',
|
ord('*'): '-',
|
||||||
@ -124,6 +120,13 @@ def filenameable(text):
|
|||||||
ord('['): '(',
|
ord('['): '(',
|
||||||
ord(']'): ')',
|
ord(']'): ')',
|
||||||
})
|
})
|
||||||
|
else:
|
||||||
|
if text.startswith("."):
|
||||||
|
text = text[1:]
|
||||||
|
if platform.system() == 'Darwin': # For Mac OS
|
||||||
|
text = text.translate({
|
||||||
|
ord(':'): '-',
|
||||||
|
})
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def unescape_html(html):
|
def unescape_html(html):
|
||||||
|
Loading…
Reference in New Issue
Block a user