fdfd
This commit is contained in:
parent
9cdfa0530b
commit
4f73c499df
2 changed files with 2 additions and 4 deletions
|
@ -31,7 +31,7 @@ app.wsgi_app = ProxyFix(app.wsgi_app, x_for=3)
|
|||
app.url_map.strict_slashes = False
|
||||
|
||||
app.config["SITE_NAME"]=environ.get("SITE_NAME").strip()
|
||||
app.config["coins_name"]=environ.get("SITE_NAME").strip()
|
||||
app.config["coins_name"]=environ.get("coins_name").strip()
|
||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||
app.config['DATABASE_URL'] = environ.get("DATABASE_CONNECTION_POOL_URL",environ.get("DATABASE_URL"))
|
||||
|
||||
|
|
|
@ -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