diff options
-rw-r--r-- | core/image.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/image.py b/core/image.py index 7e3c68d..e699d79 100644 --- a/core/image.py +++ b/core/image.py @@ -19,5 +19,7 @@ def contains_image(html: str) -> Optional[str]: soup = BeautifulSoup(html, "html.parser") image = soup.find("img", recursive=True) if image: - return image.get("src") + src = image.get("src") + if src and src.lower().split('.')[-1] in ['png', 'jpeg', 'gif', 'webp']: + return src return None |