From 6fe7c655d2b1b2be570481b87ddb3989ae31fc06 Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 11 Sep 2023 21:12:10 +0300 Subject: [PATCH] same as last commit --- files/helpers/offsitementions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/helpers/offsitementions.py b/files/helpers/offsitementions.py index e56299c79..2b17af6cf 100644 --- a/files/helpers/offsitementions.py +++ b/files/helpers/offsitementions.py @@ -44,6 +44,10 @@ def get_mentions(cache, queries, reddit_notifs_users=False): data = sorted(data, key=lambda x: int(x['created_utc']), reverse=True) for thing in data: + if not thing['permalink']: + print(thing, flush=True) + continue + if thing['subreddit'] in {'IAmA', 'PokemonGoRaids', 'SubSimulatorGPT2', 'SubSimGPT2Interactive'}: continue if 'bot' in thing['author'].lower(): continue if 'AutoModerator' == thing['author']: continue @@ -60,7 +64,6 @@ def get_mentions(cache, queries, reddit_notifs_users=False): if thing["selftext"]: selftext = thing["selftext"].replace('>', '> ')[:5000] text += f'

{selftext}

' - mentions.append({ 'permalink': thing['permalink'], 'author': thing['author'],