From 7f6675f7f91be1cd70ade6d92aa0812c35fad9bd Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 1 Jul 2023 19:41:55 +0300 Subject: [PATCH] remove unddit.com (RIP u will not be forgotten) --- files/helpers/actions.py | 16 +--------------- files/helpers/sanitize.py | 1 - files/routes/settings.py | 2 +- files/templates/settings/advanced.html | 2 +- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 005ec8d09..380b0e9b6 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -148,15 +148,7 @@ def execute_snappy(post:Post, v:User): 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): - if post.url.startswith('https://old.reddit.com/r/'): - rev = post.url.replace('https://old.reddit.com/', '') - rev = f"* [unddit.com](https://unddit.com/{rev})\n\n" - elif post.url.startswith("https://old.reddit.com/u/"): - rev = post.url.replace('https://old.reddit.com/u/', '') - rev = "* [camas.unddit.com](https://camas.unddit.com/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\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" + 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" archive_url(post.url) captured = [] @@ -180,12 +172,6 @@ def execute_snappy(post:Post, v:User): 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'* [unddit.com](https://unddit.com/{rev})\n\n' - if href.startswith('https://old.reddit.com/u/'): - rev = href.replace('https://old.reddit.com/u/', '') - addition += "* [camas.unddit.com](https://camas.unddit.com/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\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/helpers/sanitize.py b/files/helpers/sanitize.py index 1e980e002..d6700722b 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -658,7 +658,6 @@ def normalize_url(url): .replace("https://www.streamable.com", "https://streamable.com") \ .replace("https://streamable.com/", "https://streamable.com/e/") \ .replace("https://streamable.com/e/e/", "https://streamable.com/e/") \ - .replace("https://search.marsey.cat/#", "https://camas.unddit.com/#") \ .replace("https://imgur.com/", "https://i.imgur.com/") \ .replace("https://nitter.net/", "https://twitter.com/") \ .replace("https://nitter.42l.fr/", "https://twitter.com/") \ diff --git a/files/routes/settings.py b/files/routes/settings.py index fb063392a..f3c1cdbf9 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -164,7 +164,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', 'libredd.it', 'unddit.com'}: + if reddit in {'old.reddit.com', 'reddit.com', 'i.reddit.com', 'reddit.lol', 'libredd.it'}: 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 c90fc1bb4..af47da935 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.