This commit is contained in:
Aevann1 2021-08-04 20:43:04 +02:00
parent 9cdfa0530b
commit 4f73c499df
2 changed files with 2 additions and 4 deletions

View file

@ -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)