fd
This commit is contained in:
parent
c475219652
commit
13678afc5c
1 changed files with 1 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue