diff options
author | 2024-11-16 19:26:01 -0800 | |
---|---|---|
committer | 2024-11-17 13:24:46 -0800 | |
commit | 4f2a445302056a4de201927060a1da7bfbd13f11 (patch) | |
tree | 80192d9c9231ae98d47db2fd30f18cb5b68ebad7 /core/image.py | |
parent | a9409f08bac76b041fda8675858290d915a183aa (diff) | |
download | miniflux-ai-4f2a445302056a4de201927060a1da7bfbd13f11.tar.gz miniflux-ai-4f2a445302056a4de201927060a1da7bfbd13f11.tar.zst miniflux-ai-4f2a445302056a4de201927060a1da7bfbd13f11.zip |
Add extension check to imagesimage-processing
Diffstat (limited to 'core/image.py')
-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 |