diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2024-06-25 08:00:09 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-06-25 11:12:41 +0200 |
commit | b8fa4d61958c5c78d312376bfcfc5d2c5863ab69 (patch) | |
tree | 4514b66d84cffda0fdc91b1f4ae2fdc5708e75b4 | |
parent | 9a9ca307fe53ea8ed9d18a06a1a7da9fa4a1c28f (diff) | |
download | searxng-b8fa4d61958c5c78d312376bfcfc5d2c5863ab69.tar.gz searxng-b8fa4d61958c5c78d312376bfcfc5d2c5863ab69.zip |
[fix] bing news results return invalid images
Closes: https://github.com/searxng/searxng/issues/3502
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
-rw-r--r-- | searx/engines/bing_news.py | 4 |
1 files changed, 3 insertions, 1 deletions
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( { |