From d05795a5606165fda4dad7802b83309bf5e957ad Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 5 Mar 2024 22:40:25 +0200 Subject: [PATCH] fix this https://rdrama.net/post/250945/the-trial-of-hannah-gutierrezreed/6055913#context --- files/helpers/actions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 475de32d5..d39009e60 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -201,14 +201,15 @@ def execute_snappy(post, v): title = i.group(2) captured.append((href, title)) + captured2 = [] for href, title in captured: - if href.startswith('/') or href.startswith(f'{SITE_FULL}/') or href.startswith(f'{SITE_FULL_IMAGES}/'): - captured.remove((href, title)) + if not (href.startswith('/') or href.startswith(f'{SITE_FULL}/') or href.startswith(f'{SITE_FULL_IMAGES}/')): + captured2.append((href, title)) - if captured: + if captured2: body += "**Snapshots:**\n\n" - for href, title in captured: + for href, title in captured2: if f'**[{title}]({href})**:\n\n' not in body: addition = f'**[{title}]({href})**:\n\n' if href.startswith('https://old.reddit.com/r/'):