Update download.py
This commit is contained in:
parent
a02f91fdf2
commit
ec782c4ce1
@ -31,7 +31,7 @@ class grab():
|
||||
path = urlsplit(img_url).path
|
||||
ext = os.path.splitext(path)[-1] or '.jpeg'
|
||||
|
||||
safe_name = re.sub(r'[\\/:*?"<>|]', '_', alt_value.replace(' ', '_'))
|
||||
safe_name = re.sub(r'[^a-zA-Z0-9\s]', '', alt_value).replace(' ', '_')
|
||||
filename = f"{safe_name}{ext}"
|
||||
filepath = os.path.join(save_dir, filename)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user