master
Aevann1 2021-09-02 03:05:09 +02:00
parent 27ba15307d
commit aaffc9a846
1 changed files with 1 additions and 0 deletions

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: