diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 26c1d94a1..fc33347ba 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -5,6 +5,7 @@ from files.helpers.const import * from files.helpers.get import * from files.helpers.sanitize import * import random +from urllib.parse import quote if SITE_NAME == 'PCM': snappyquotes = [] else: snappyquotes = [f':#{x}:' for x in marseys_const2] @@ -33,6 +34,10 @@ def badge_grant(user, badge_id, description=None, url=None): f"![]({badge.path})\n\n{badge.name}") +def archiveorg(url): + try: requests.get(f'https://web.archive.org/save/{url}', headers={'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}, timeout=100) + except: pass + def execute_snappy(post, v): snappy = get_account(SNAPPY_ID) diff --git a/files/routes/posts.py b/files/routes/posts.py index 47c42d196..8a4e7b5b4 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -510,10 +510,6 @@ def edit_post(pid, v): return redirect(p.permalink) -def archiveorg(url): - try: requests.get(f'https://web.archive.org/save/{url}', headers={'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}, timeout=100) - except: pass - def thumbnail_thread(pid):