From d7797d2c0d3c6587be3f0903bc54cb99fc8985b0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 1 Sep 2021 13:31:47 +0200 Subject: [PATCH] fdfd --- files/helpers/images.py | 2 +- files/routes/posts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/helpers/images.py b/files/helpers/images.py index b743896d6..a062cda54 100644 --- a/files/helpers/images.py +++ b/files/helpers/images.py @@ -40,7 +40,7 @@ def upload_file(file=None, resize=False, png=False): req = requests.post('https://api.imgur.com/3/upload.json', headers = {"Authorization": f"Client-ID {IMGUR_KEY}"}, data=data) resp = req.json()['data'] url = resp['link'] - if not "_d" in url: + if not "_d." in url: url = url.replace(".png", "_d.png").replace(".jpg", "_d.jpg").replace(".jpeg", "_d.jpeg") if "_d." in url: url += "?maxwidth=9999" except: return diff --git a/files/routes/posts.py b/files/routes/posts.py index fab9533fb..91abf6166 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -520,7 +520,7 @@ def submit_post(v): if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"): url = url.replace("https://streamable.com/", "https://streamable.com/e/") - if "i.imgur.com" in url and "_d" not in url: + if "i.imgur.com" in url and "_d." not in url: url = url.replace(".png", "_d.png").replace(".jpg", "_d.jpg").replace(".jpeg", "_d.jpeg") if "_d." in url: url += "?maxwidth=9999"