From b8fa4d61958c5c78d312376bfcfc5d2c5863ab69 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 25 Jun 2024 08:00:09 +0200 Subject: [PATCH] [fix] bing news results return invalid images Closes: https://github.com/searxng/searxng/issues/3502 Signed-off-by: Markus Heiser --- searx/engines/bing_news.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/searx/engines/bing_news.py b/searx/engines/bing_news.py index e93f7fea3..2e759bc7a 100644 --- a/searx/engines/bing_news.py +++ b/searx/engines/bing_news.py @@ -123,7 +123,9 @@ def response(resp): thumbnail = None imagelink = eval_xpath_getindex(newsitem, './/a[@class="imagelink"]//img', 0, None) if imagelink is not None: - thumbnail = 'https://www.bing.com/' + imagelink.attrib.get('src') + thumbnail = imagelink.attrib.get('src') + if not thumbnail.startswith("https://www.bing.com"): + thumbnail = 'https://www.bing.com/' + thumbnail results.append( {