forked from MarseyWorld/MarseyWorld
master
parent
2128c1bcca
commit
2cf6ad60a3
|
@ -278,9 +278,9 @@ def api_comment(v):
|
|||
file=request.files["file"]
|
||||
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
|
||||
|
||||
file.save(f"image.{file.format}", optimize=True, quality=30)
|
||||
if 'pcmemes.net' in request.host: url = upload_ibb(f"image.{file.format}")
|
||||
else: url = upload_imgur(f"image.{file.format}")
|
||||
file.save(f"image.{file.filename.split('.')[-1]}")
|
||||
if 'pcmemes.net' in request.host: url = upload_ibb(f"image.{file.filename.split('.')[-1]}")
|
||||
else: url = upload_imgur(f"image.{file.filename.split('.')[-1]}")
|
||||
|
||||
body = request.form.get("body") + f"\n![]({url})"
|
||||
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n").replace("\n\n\n", "\n\n")
|
||||
|
|
Loading…
Reference in New Issue