From 916739d6b41957c3f277dea7c1429488560a3784 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 12 May 2024 17:52:52 +0200 Subject: [mod] simple theme: drop img_src from default results The use of img_src AND thumbnail in the default results makes no sense (only a thumbnail is needed). In the current state this is rather confusing, because img_src is displayed like a thumbnail (small) and thumbnail is displayed like an image (large). Signed-off-by: Markus Heiser --- searx/engines/google.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'searx/engines/google.py') diff --git a/searx/engines/google.py b/searx/engines/google.py index ef82a057b..90d687a4e 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -365,17 +365,17 @@ def response(resp): logger.debug('ignoring item from the result_xpath list: missing content of title "%s"', title) continue - img_src = content_nodes[0].xpath('.//img/@src') - if img_src: - img_src = img_src[0] - if img_src.startswith('data:image'): + thumbnail = content_nodes[0].xpath('.//img/@src') + if thumbnail: + thumbnail = thumbnail[0] + if thumbnail.startswith('data:image'): img_id = content_nodes[0].xpath('.//img/@id') if img_id: - img_src = data_image_map.get(img_id[0]) + thumbnail = data_image_map.get(img_id[0]) else: - img_src = None + thumbnail = None - results.append({'url': url, 'title': title, 'content': content, 'img_src': img_src}) + results.append({'url': url, 'title': title, 'content': content, 'thumbnail': thumbnail}) except Exception as e: # pylint: disable=broad-except logger.error(e, exc_info=True) -- cgit v1.2.3