diff --git a/drama/helpers/images.py b/drama/helpers/images.py index 1be52591b..79d399476 100644 --- a/drama/helpers/images.py +++ b/drama/helpers/images.py @@ -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"