fdfd
This commit is contained in:
parent
9cdfa0530b
commit
4f73c499df
2 changed files with 2 additions and 4 deletions
|
@ -38,9 +38,7 @@ def upload_file(file=None, resize=False, png=False):
|
|||
req = requests.post('https://api.imgur.com/3/upload.json', headers = {"Authorization": f"Client-ID {imgurkey}"}, data=data)
|
||||
resp = req.json()['data']
|
||||
url = resp['link'].replace(".png", "_d.png").replace(".jpg", "_d.jpg").replace(".jpeg", "_d.jpeg") + "?maxwidth=9999"
|
||||
except:
|
||||
print(req.text)
|
||||
return
|
||||
except: return
|
||||
|
||||
new_image = Image(text=url, deletehash=resp["deletehash"])
|
||||
g.db.add(new_image)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue