From 2b20b35aa75f5fd0af7adb5382873583a56743bc Mon Sep 17 00:00:00 2001 From: fireworks88 Date: Wed, 27 Oct 2021 10:42:52 +0200 Subject: [PATCH] pee --- files/routes/posts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/routes/posts.py b/files/routes/posts.py index d21440a82..b2301796a 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -862,16 +862,19 @@ def submit_post(v): 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={quote(new_post.url)}&run=1) (click to archive)\n" gevent.spawn(archiveorg, new_post.url) + # archive other urls in post url_regex = '(.+)' for url_match in re.finditer(url_regex, new_post.body_html): href = url_match.group(1) + print(href) title = url_match.group(2) body += f'**[{title}]({href})**:\n\n' body += f'* [reveddit.com](https://reveddit.com/{href})\n' body += f'* [archive.org](https://web.archive.org/{href})\n' body += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n' gevent.spawn(archiveorg, href) + body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md)