added a safe-filename function so we will be sure the suggested filename won't break anything in the operating system
This commit is contained in:
@@ -90,4 +90,8 @@ def transform_audio_url(url):
|
||||
url = url.replace("/"+parts[-2], "")
|
||||
else:
|
||||
url = url.replace("/"+parts[-3], "")
|
||||
return url
|
||||
return url
|
||||
|
||||
def safe_filename(filename):
|
||||
allowed_symbols = ["_", ".", ",", "-", "(", ")"]
|
||||
return "".join([c for c in filename if c.isalpha() or c.isdigit() or c==' ' or c in allowed_symbols]).rstrip()
|
Reference in New Issue
Block a user