From 1be56014cb7159097b73c9fa5f46c587e378435e Mon Sep 17 00:00:00 2001 From: raileo98 <164594063+raileo98@users.noreply.github.com> Date: Tue, 22 Oct 2024 03:14:22 +0000 Subject: [PATCH] Update rthk.py --- code/rthk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/rthk.py b/code/rthk.py index 71047a841..c3c8f1627 100644 --- a/code/rthk.py +++ b/code/rthk.py @@ -321,7 +321,7 @@ async def process_article(fg, category, article): latest_imgUrl = await optimize_image_quality(imgUrl) imgAlt = image.get('alt', '') - imgAlt = html.escape(imgAlt.strip()) + imgAlt = html.escape(imgAlt.strip()).strip() if latest_imgUrl: latest_imgUrl = latest_imgUrl.replace('https://images.weserv.nl/', 'https://images.weserv.nl/') @@ -357,7 +357,7 @@ async def process_article(fg, category, article): latest_imgUrl = await optimize_image_quality(imgUrl) imgAlt = article_soup.select_one('.detailNewsSlideTitleText').get_text() - imgAlt = html.escape(imgAlt.strip()) + imgAlt = html.escape(imgAlt.strip()).strip() if latest_imgUrl: latest_imgUrl = latest_imgUrl.replace('https://images.weserv.nl/', 'https://images.weserv.nl/')