From cd5d0c7c928c5fa1456394f0fd55b8b15f8c83af Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 22 Sep 2022 22:45:26 +0200 Subject: [PATCH] dont archive rdrama.org --- files/helpers/actions.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index bd7636408..4a225a9b0 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -92,7 +92,7 @@ def execute_snappy(post, v): body += "\n\n" - if post.url and not post.url.startswith(SITE_FULL): + if post.url and not post.url.startswith(SITE_FULL) and not post.url.startswith('/') and not post.url.startswith('https://rdrama.org'): 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" @@ -101,10 +101,8 @@ def execute_snappy(post, v): rev = f"* [camas.unddit.com](https://camas.unddit.com/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n" else: rev = '' - newposturl = post.url - if newposturl.startswith('/'): newposturl = f"{SITE_FULL}{newposturl}" - body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{newposturl})\n* [archive.ph](https://archive.ph/?url={quote(newposturl)}&run=1) (click to archive)\n* [ghostarchive.org](https://ghostarchive.org/search?term={quote(newposturl)}) (click to archive)\n\n" - archive_url(newposturl) + body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{post.url})\n* [archive.ph](https://archive.ph/?url={quote(post.url)}&run=1) (click to archive)\n* [ghostarchive.org](https://ghostarchive.org/search?term={quote(post.url)}) (click to archive)\n\n" + archive_url(post.url) captured = [] body_for_snappy = post.body_html.replace(' data-src="', ' src="') @@ -123,7 +121,7 @@ def execute_snappy(post, v): for href, title in captured: - if href.startswith(SITE_FULL): continue + if href.startswith(SITE_FULL) or href.startswith('https://rdrama.org'): continue if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n"