fdfd
parent
b40f8b754a
commit
cc067d0c59
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue