Update sgspider.py

Handle image URLs that contain extra characters in filename after file extension.
This commit is contained in:
Ronald Farrer 2024-09-04 14:16:11 -07:00 committed by GitHub
parent 1f63c9138e
commit 854eac8c49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,6 +121,7 @@ def dlimgs(girl, album, url):
os.makedirs(path, exist_ok=True)
filename = os.path.join(path, re.sub('(.*)/', "", os.path.join(path, url)))
filename = filename.strip()
filename = filename.split("?")[0]
print("Looking at: " + str(url))
if os.path.exists(filename.strip()) == True:
print("File: " + str(filename) + " already downloaded, skipping!")