Skip to content

Commit

Permalink
Strip those pesky bot images
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Sep 1, 2024
1 parent 0d2dc34 commit 780f091
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bbcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ def clean_unit3d_description(self, desc, site):
# Remove the [img] tag and its contents from the description
desc = re.sub(rf"\[img[^\]]*\]{re.escape(img_url)}\[/img\]", '', desc, flags=re.IGNORECASE)

# Filter out bot images from imagelist
bot_image_urls = [
"https://blutopia.xyz/favicon.ico", # Example bot image URL
# Add any other known bot image URLs here
]
imagelist = [img for img in imagelist if img['img_url'] not in bot_image_urls]

# Restore spoiler tags
if spoiler_placeholders:
for i, spoiler in enumerate(spoiler_placeholders):
Expand Down

0 comments on commit 780f091

Please sign in to comment.