From cae700aa3a033a29c1f8b07639963fc44d48c11e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 6 Oct 2021 02:52:58 +0200 Subject: [PATCH] dfsdsf --- files/routes/comments.py | 1 + files/routes/posts.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 56a0fe78ab..c20e0ef3cf 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -9,6 +9,7 @@ from files.routes.front import comment_idlist from pusher_push_notifications import PushNotifications from flask import * from files.__main__ import app, limiter +from urllib.parse import ParseResult, urlunparse, urlparse site = environ.get("DOMAIN").strip() diff --git a/files/routes/posts.py b/files/routes/posts.py index 6544c87bf6..999f25a75b 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1,10 +1,7 @@ import time -from urllib.parse import urlparse import mistletoe -import urllib.parse import gevent import requests - from files.helpers.wrappers import * from files.helpers.sanitize import * from files.helpers.filters import * @@ -19,6 +16,7 @@ from io import BytesIO from files.__main__ import app, limiter, cache, db_session from PIL import Image as PILimage from .front import frontlist, changeloglist +from urllib.parse import ParseResult, urlunparse, urlparse, quote site = environ.get("DOMAIN").strip() CATBOX_KEY = environ.get("CATBOX_KEY").strip() @@ -980,7 +978,7 @@ def submit_post(v): body += "\n\n---\n\n" else: body = "" if new_post.url: - body += f"Snapshots:\n\n* [reveddit.com](https://reveddit.com/{new_post.url})\n* [archive.org](https://web.archive.org/{new_post.url})\n* [archive.ph](https://archive.ph/?url={urllib.parse.quote(new_post.url)}&run=1) (click to archive)" + body += f"Snapshots:\n\n* [reveddit.com](https://reveddit.com/{new_post.url})\n* [archive.org](https://web.archive.org/{new_post.url})\n* [archive.ph](https://archive.ph/?url={quote(new_post.url)}&run=1) (click to archive)" gevent.spawn(archiveorg, new_post.url) body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md)