forked from MarseyWorld/MarseyWorld
sdf
parent
ef018428e2
commit
32285d464a
|
@ -263,7 +263,7 @@ def api_comment(v):
|
|||
file=request.files["file"]
|
||||
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
|
||||
|
||||
name = f'/hostedimages/{time.time()}{secrets.token_urlsafe(8)}'
|
||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}'
|
||||
file.save(name)
|
||||
url = process_image(name)
|
||||
|
||||
|
@ -684,7 +684,7 @@ def edit_comment(cid, v):
|
|||
file=request.files["file"]
|
||||
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
|
||||
|
||||
name = f'/hostedimages/{time.time()}{secrets.token_urlsafe(8)}'
|
||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}'
|
||||
file.save(name)
|
||||
url = process_image(name)
|
||||
|
||||
|
|
|
@ -509,7 +509,7 @@ def thumbnail_thread(pid):
|
|||
db.close()
|
||||
return
|
||||
|
||||
name = f'/hostedimages/{time.time()}{secrets.token_urlsafe(8)}'
|
||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}'
|
||||
|
||||
with open(name, "wb") as file:
|
||||
for chunk in image_req.iter_content(1024):
|
||||
|
@ -836,7 +836,7 @@ def submit_post(v):
|
|||
), 403
|
||||
|
||||
if file.content_type.startswith('image/'):
|
||||
name = f'/hostedimages/{time.time()}{secrets.token_urlsafe(8)}'
|
||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}'
|
||||
file.save(name)
|
||||
new_post.url = process_image(name)
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ def settings_profile_post(v):
|
|||
if request.headers.get("Authorization"): return {"error": f"Image files only"}, 400
|
||||
else: return render_template("settings_profile.html", v=v, error=f"Image files only."), 400
|
||||
|
||||
name = f'/hostedimages/{time.time()}{secrets.token_urlsafe(8)}'
|
||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}'
|
||||
file.save(name)
|
||||
url = process_image(name)
|
||||
|
||||
|
@ -506,13 +506,13 @@ def settings_images_profile(v):
|
|||
|
||||
file = request.files["profile"]
|
||||
|
||||
name = f'/hostedimages/{time.time()}{secrets.token_urlsafe(8)}'
|
||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}'
|
||||
file.save(name)
|
||||
highres = process_image(name)
|
||||
|
||||
if not highres: abort(400)
|
||||
|
||||
name = f'/hostedimages/{time.time()}{secrets.token_urlsafe(8)}'
|
||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}'
|
||||
file.save(name)
|
||||
imageurl = process_image(name, True)
|
||||
|
||||
|
@ -537,7 +537,7 @@ def settings_images_banner(v):
|
|||
|
||||
file = request.files["banner"]
|
||||
|
||||
name = f'/hostedimages/{time.time()}{secrets.token_urlsafe(8)}'
|
||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}'
|
||||
file.save(name)
|
||||
imageurl = process_image(name)
|
||||
|
||||
|
|
Loading…
Reference in New Issue