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"