diff --git a/files/helpers/actions.py b/files/helpers/actions.py index b9997a147..1f2e5c831 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -157,7 +157,12 @@ def execute_snappy(post, v): body += "\n\n" if post.url and not post.url.startswith('/') and not post.url.startswith(f'{SITE_FULL}/') and not post.url.startswith(SITE_FULL_IMAGES): - body += f"Snapshots:\n\n* [archive.org](https://web.archive.org/{post.url})\n\n* [ghostarchive.org](https://ghostarchive.org/search?term={quote(post.url)})\n\n* [archive.ph](https://archive.ph/?url={quote(post.url)}&run=1) (click to archive)\n\n" + if post.url.startswith('https://old.reddit.com/r/'): + rev = post.url.replace('https://old.reddit.com/', '') + rev = f"* [undelete.pullpush.io](https://undelete.pullpush.io/{rev})\n\n" + else: rev = '' + + body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{post.url})\n\n* [ghostarchive.org](https://ghostarchive.org/search?term={quote(post.url)})\n\n* [archive.ph](https://archive.ph/?url={quote(post.url)}&run=1) (click to archive)\n\n" archive_url(post.url) captured = [] @@ -181,6 +186,9 @@ def execute_snappy(post, v): if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n" if f'**[{title}]({href})**:\n\n' not in body: addition = f'**[{title}]({href})**:\n\n' + if href.startswith('https://old.reddit.com/r/'): + rev = href.replace('https://old.reddit.com/', '') + addition += f'* [undelete.pullpush.io](https://undelete.pullpush.io/{rev})\n\n' addition += f'* [archive.org](https://web.archive.org/{href})\n\n' addition += f'* [ghostarchive.org](https://ghostarchive.org/search?term={quote(href)})\n\n' addition += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n\n' diff --git a/files/routes/settings.py b/files/routes/settings.py index 086e493ee..3523549db 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -133,7 +133,7 @@ def settings_personal_post(v): updated = True elif request.values.get("reddit", v.reddit) != v.reddit: reddit = request.values.get("reddit") - if reddit in {'old.reddit.com', 'reddit.com', 'i.reddit.com', 'reddit.lol', 'libreddit.hu'}: + if reddit in {'old.reddit.com', 'reddit.com', 'i.reddit.com', 'reddit.lol', 'libreddit.hu', 'undelete.pullpush.io'}: updated = True v.reddit = reddit elif request.values.get("poor", v.poor) != v.poor: diff --git a/files/templates/settings/advanced.html b/files/templates/settings/advanced.html index 919eb2d1b..1797cbd4c 100644 --- a/files/templates/settings/advanced.html +++ b/files/templates/settings/advanced.html @@ -115,7 +115,7 @@
Change the domain you would like to view reddit posts in.