🐛 Fix format jpeg img

This commit is contained in:
omg-xtao 2023-08-28 00:20:12 +08:00 committed by GitHub
parent 28250576fc
commit ad981468a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,8 +46,10 @@ def get_description(soup: BeautifulSoup) -> str:
def format_image_url(url: str) -> str:
lower_url = url.lower()
if lower_url.endswith(".png") or lower_url.endswith(".jpg"):
url += get_images_params()
for ext in (".png", ".jpg", ".jpeg"):
if lower_url.endswith(ext):
url += get_images_params()
break
return f'<img src="{url}"/>'