summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2024-05-12 17:52:52 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-05-16 07:30:38 +0200
commit916739d6b41957c3f277dea7c1429488560a3784 (patch)
tree70f898ec367b9ab16ab72b2b4f9ed62db458cb4b /searx/engines/google.py
parent0f2f52f0b52f08e6706fc32da090f682aaf42d41 (diff)
[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 <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/google.py')
-rw-r--r--searx/engines/google.py14
1 files changed, 7 insertions, 7 deletions
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)