forked from rDrama/rDrama
Merge branch 'frost' into dasher
commit
d8c4075f17
|
@ -58,7 +58,7 @@ app.config["RATELIMIT_ENABLED"] = True
|
||||||
app.config["RATELIMIT_DEFAULTS_DEDUCT_WHEN"]=lambda:True
|
app.config["RATELIMIT_DEFAULTS_DEDUCT_WHEN"]=lambda:True
|
||||||
app.config["RATELIMIT_DEFAULTS_EXEMPT_WHEN"]=lambda:False
|
app.config["RATELIMIT_DEFAULTS_EXEMPT_WHEN"]=lambda:False
|
||||||
app.config["RATELIMIT_HEADERS_ENABLED"]=True
|
app.config["RATELIMIT_HEADERS_ENABLED"]=True
|
||||||
app.config["CACHE_TYPE"] = "filesystem"
|
app.config["CACHE_TYPE"] = "redis"
|
||||||
app.config["CACHE_DIR"] = "cache"
|
app.config["CACHE_DIR"] = "cache"
|
||||||
app.config["RATELIMIT_STORAGE_URL"] = environ.get("REDIS_URL", "redis://localhost")
|
app.config["RATELIMIT_STORAGE_URL"] = environ.get("REDIS_URL", "redis://localhost")
|
||||||
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
|
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
|
||||||
|
|
|
@ -577,18 +577,19 @@ def edit_post(pid, v):
|
||||||
@auth_required
|
@auth_required
|
||||||
def get_post_title(v):
|
def get_post_title(v):
|
||||||
|
|
||||||
url = request.values.get("url", None)
|
abort(400)
|
||||||
if not url: abort(400)
|
# url = request.values.get("url", None)
|
||||||
|
# if not url: abort(400)
|
||||||
|
|
||||||
try: x = requests.get(url, headers=titleheaders, timeout=5)
|
# try: x = requests.get(url, headers=titleheaders, timeout=5)
|
||||||
except: abort(400)
|
# except: abort(400)
|
||||||
|
|
||||||
soup = BeautifulSoup(x.content, 'html.parser')
|
# soup = BeautifulSoup(x.content, 'html.parser')
|
||||||
|
|
||||||
title = soup.find('title')
|
# title = soup.find('title')
|
||||||
if not title: abort(400)
|
# if not title: abort(400)
|
||||||
|
|
||||||
return {"url": url, "title": title.string}
|
# return {"url": url, "title": title.string}
|
||||||
|
|
||||||
|
|
||||||
def archiveorg(url):
|
def archiveorg(url):
|
||||||
|
|
Loading…
Reference in New Issue