forked from MarseyWorld/MarseyWorld
fdfd
parent
c93eff4c69
commit
d7797d2c0d
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue