From f05566d925772ae38274c0b4b1b4ea6d4c1733ee Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Thu, 12 Sep 2024 10:10:20 +0200 Subject: [PATCH 1/2] [fix] json_engine: Fix result fields being mixed up Fixes #3810. --- searx/engines/json_engine.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/searx/engines/json_engine.py b/searx/engines/json_engine.py index 47cf16372..9d919a63d 100644 --- a/searx/engines/json_engine.py +++ b/searx/engines/json_engine.py @@ -146,7 +146,11 @@ def response(resp): } ) else: - for url, title, content in zip(query(json, url_query), query(json, title_query), query(json, content_query)): + for result in json: + url = query(result, url_query)[0] + title = query(result, title_query)[0] + content = query(result, content_query)[0] + results.append( { 'url': url_prefix + to_string(url), From 9e2bfe14db3020a5020491721f8784672c6060f2 Mon Sep 17 00:00:00 2001 From: Finn Steffens <34682885+0xhtml@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:51:47 +0200 Subject: [PATCH 2/2] [feat] engine: add right dao * [feat] engine: add right dao * [enh] right dao engine: allow additional classes Allow additional classes while parsing to prevent the engine from breaking in the future if additional classes are added to the elements. Co-authored-by: Bnyro --------- Co-authored-by: Bnyro --- searx/settings.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/searx/settings.yml b/searx/settings.yml index a05542321..4417485bc 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -1548,6 +1548,24 @@ engines: page_size: 25 disabled: true + - name: right dao + engine: xpath + paging: true + page_size: 12 + search_url: https://rightdao.com/search?q={query}&start={pageno} + results_xpath: //div[contains(@class, "description")] + url_xpath: ../div[contains(@class, "title")]/a/@href + title_xpath: ../div[contains(@class, "title")] + content_xpath: . + categories: general + shortcut: rd + disabled: true + about: + website: https://rightdao.com/ + use_official_api: false + require_api_key: false + results: HTML + - name: rottentomatoes engine: rottentomatoes shortcut: rt