remotes/1693045480750635534/spooky-22
Aevann1 2021-07-30 13:08:55 +02:00
parent b40f8b754a
commit cc067d0c59
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,8 @@ def upload_file(file=None, resize=False):
om.info = i.info
om.save("image.gif", save_all=True, append_images=list(frames))
req = requests.post('https://api.imgur.com/3/upload.json', headers = {"Authorization": f"Client-ID {imgurkey}"}, data = {"type": "file", "image": "image.gif"})
with open('D:/image.gif', 'rb') as f:
req = requests.post('https://api.imgur.com/3/upload.json', headers = {"Authorization": f"Client-ID {imgurkey}"}, data={'image': f})
try:
resp = req.json()['data']
url = resp['link'].replace(".png", "_d.png").replace(".jpg", "_d.jpg").replace(".jpeg", "_d.jpeg") + "?maxwidth=9999"