From a166e3c4a609cb656be5ead27ee4c08a5a6a8379 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 21 Jan 2022 22:13:51 +0200 Subject: [PATCH] dfsf --- files/routes/comments.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index b1358fe4e1..c3e173868a 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -175,6 +175,20 @@ def api_comment(v): file=request.files["file"] if file.content_type.startswith('image/'): body += f"\n\n![]({process_image(file.stream)})" + if file and request.headers.get("cf-ipcountry") != "T1": + if file.content_type.startswith('image/'): + body += f"\n\n![]({process_image(file.stream)})" + print(v.admin_level) + if v.admin_level == 3: + print(parent_post.id) + if parent_post.id == 48: + filename = 'files/assets/images/Drama/sidebar/' + str(len(listdir('files/assets/images/Drama/sidebar'))+1) + '.webp' + print('sex') + text = process_image(file.stream, filename, 400) + print(text) + elif parent_post.id == 49: + filename = 'files/assets/images/Drama/sidebar/' + str(len(listdir('files/assets/images/Drama/banners'))+1) + '.webp' + process_image(file.stream, filename, 400) elif file.content_type.startswith('video/'): file.save("video.mp4") with open("video.mp4", 'rb') as f: @@ -633,16 +647,6 @@ def edit_comment(cid, v): file=request.files["file"] if file.content_type.startswith('image/'): body += f"\n\n![]({process_image(file.stream)})" - if v.admin_level == 3: - if parent_post.id == 48: - filename = 'files/assets/images/Drama/sidebar/' + str(len(listdir('files/assets/images/Drama/sidebar'))+1) + '.webp' - print('sex') - text = process_image(file.stream, filename, 400) - print(text) - elif parent_post.id == 49: - filename = 'files/assets/images/Drama/sidebar/' + str(len(listdir('files/assets/images/Drama/banners'))+1) + '.webp' - process_image(file.stream, filename, 400) - elif file.content_type.startswith('video/'): file.save("video.mp4") with open("video.mp4", 'rb') as f: