remotes/1693045480750635534/spooky-22
Aevann1 2021-09-01 13:31:47 +02:00
parent c93eff4c69
commit d7797d2c0d
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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"