summaryrefslogtreecommitdiff
path: root/searx/engines/brave.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/brave.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/brave.py')
-rw-r--r--searx/engines/brave.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/engines/brave.py b/searx/engines/brave.py
index 6d4ab3a44..04c2931f9 100644
--- a/searx/engines/brave.py
+++ b/searx/engines/brave.py
@@ -296,14 +296,14 @@ def _parse_search(resp):
content_tag = eval_xpath_getindex(result, './/div[contains(@class, "snippet-description")]', 0, default='')
pub_date_raw = eval_xpath(result, 'substring-before(.//div[contains(@class, "snippet-description")], "-")')
- img_src = eval_xpath_getindex(result, './/img[contains(@class, "thumb")]/@src', 0, default='')
+ thumbnail = eval_xpath_getindex(result, './/img[contains(@class, "thumb")]/@src', 0, default='')
item = {
'url': url,
'title': extract_text(title_tag),
'content': extract_text(content_tag),
'publishedDate': _extract_published_date(pub_date_raw),
- 'img_src': img_src,
+ 'thumbnail': thumbnail,
}
video_tag = eval_xpath_getindex(
@@ -324,7 +324,7 @@ def _parse_search(resp):
)
item['publishedDate'] = _extract_published_date(pub_date_raw)
else:
- item['img_src'] = eval_xpath_getindex(video_tag, './/img/@src', 0, default='')
+ item['thumbnail'] = eval_xpath_getindex(video_tag, './/img/@src', 0, default='')
result_list.append(item)
@@ -351,7 +351,7 @@ def _parse_news(json_resp):
'publishedDate': _extract_published_date(result['age']),
}
if result['thumbnail'] is not None:
- item['img_src'] = result['thumbnail']['src']
+ item['thumbnail'] = result['thumbnail']['src']
result_list.append(item)
return result_list