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'],