This commit is contained in:
Aevann1 2021-09-02 03:05:09 +02:00
parent c475219652
commit 13678afc5c

View file

@ -38,6 +38,7 @@ def upload_file(file=None, resize=False, png=False):
with open(filedir, 'rb') as f:
data={'image': base64.b64encode(f.read())}
req = requests.post('https://api.imgur.com/3/upload.json', headers = {"Authorization": f"Client-ID {IMGUR_KEY}"}, data=data)
print(req.json())
resp = req.json()['data']
url = resp['link']
if not "_d." in url: