fd
This commit is contained in:
parent
e5ff4165b9
commit
44ce46513a
3 changed files with 8 additions and 6 deletions
|
@ -110,7 +110,7 @@ def upload_video(file):
|
||||||
resp = r.json()['data']
|
resp = r.json()['data']
|
||||||
except requests.HTTPError as e:
|
except requests.HTTPError as e:
|
||||||
raise UploadException("Invalid video. Make sure it's 1 minute long or shorter.")
|
raise UploadException("Invalid video. Make sure it's 1 minute long or shorter.")
|
||||||
except Exception:
|
except:
|
||||||
raise UploadException("Error, please try again later.")
|
raise UploadException("Error, please try again later.")
|
||||||
finally:
|
finally:
|
||||||
remove(file_path)
|
remove(file_path)
|
||||||
|
|
|
@ -212,7 +212,7 @@ def sanitize(sanitized, noimages=False):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not session.get("favorite_emojis"): session["favorite_emojis"] = {}
|
if not session.get("favorite_emojis"): session["favorite_emojis"] = {}
|
||||||
except Exception:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if start in sanitized and end in sanitized and start in sanitized.split(end)[0] and end in sanitized.split(start)[1]: sanitized = sanitized.replace(start, '<span class="spoiler">').replace(end, '</span>')
|
if start in sanitized and end in sanitized and start in sanitized.split(end)[0] and end in sanitized.split(start)[1]: sanitized = sanitized.replace(start, '<span class="spoiler">').replace(end, '</span>')
|
||||||
|
@ -224,7 +224,7 @@ def sanitize(sanitized, noimages=False):
|
||||||
try:
|
try:
|
||||||
if i.group(1) in session["favorite_emojis"]: session["favorite_emojis"][i.group(1)] += 1
|
if i.group(1) in session["favorite_emojis"]: session["favorite_emojis"][i.group(1)] += 1
|
||||||
else: session["favorite_emojis"][i.group(1)] = 1
|
else: session["favorite_emojis"][i.group(1)] = 1
|
||||||
except Exception:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for i in re.finditer(':([^ ]{1,30}?):', sanitized):
|
for i in re.finditer(':([^ ]{1,30}?):', sanitized):
|
||||||
|
@ -234,7 +234,7 @@ def sanitize(sanitized, noimages=False):
|
||||||
try:
|
try:
|
||||||
if i.group(1) in session["favorite_emojis"]: session["favorite_emojis"][i.group(1)] += 1
|
if i.group(1) in session["favorite_emojis"]: session["favorite_emojis"][i.group(1)] += 1
|
||||||
else: session["favorite_emojis"][i.group(1)] = 1
|
else: session["favorite_emojis"][i.group(1)] = 1
|
||||||
except Exception:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ def check_ban_evade(v):
|
||||||
comment.ban_reason="ban evasion"
|
comment.ban_reason="ban evasion"
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
|
|
||||||
|
try:
|
||||||
ma=ModAction(
|
ma=ModAction(
|
||||||
kind="ban_comment",
|
kind="ban_comment",
|
||||||
user_id=AUTOJANNY_ACCOUNT,
|
user_id=AUTOJANNY_ACCOUNT,
|
||||||
|
@ -89,6 +90,7 @@ def check_ban_evade(v):
|
||||||
note="ban evasion"
|
note="ban evasion"
|
||||||
)
|
)
|
||||||
g.db.add(ma)
|
g.db.add(ma)
|
||||||
|
except: pass
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
try: abort(403)
|
try: abort(403)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue