From 5bae05514b7363c09542a4ca09ff68d0cf9d0493 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 25 May 2026 21:42:37 +0200 Subject: [PATCH] [feat] engines: add zapmeta general search engine --- searx/engines/xpath.py | 10 +++++++++- searx/settings.yml | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py index 7efb5b826..2d1763bf9 100644 --- a/searx/engines/xpath.py +++ b/searx/engines/xpath.py @@ -174,6 +174,10 @@ number, but an offset.''' first_page_num = 1 '''Number of the first page (usually 0 or 1).''' +send_page_num_on_first_page = True +'''Whether to include the page number in the request for the first page. +This can help if an engine blocks request that send a page number for the first page.''' + time_range_support = False '''Engine supports search time range.''' @@ -238,10 +242,14 @@ def request(query, params): if safe_search_val is not None: safe_search = safe_search_map[safe_search_val] + pageno = "" + if send_page_num_on_first_page or params["pageno"] != 1: + pageno = (params['pageno'] - 1) * page_size + first_page_num + fargs = { 'query': urlencode({'q': query})[2:], 'lang': lang, - 'pageno': (params['pageno'] - 1) * page_size + first_page_num, + 'pageno': pageno, 'time_range': time_range, 'safe_search': safe_search, } diff --git a/searx/settings.yml b/searx/settings.yml index a339b0a91..fdb86b3d2 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -2608,6 +2608,23 @@ engines: shortcut: wttr timeout: 9.0 + - name: zapmeta + engine: xpath + shortcut: zpm + search_url: https://www.zapmeta.com/search?q={query}&pg={pageno} + results_xpath: //article[contains(@class, "organic-results-item")] + url_xpath: ./h2/a/@href + title_xpath: ./h2 + content_xpath: ./p + paging: true + send_page_num_on_first_page: false # otherwise blocks requests + disabled: true + about: + website: https://www.zapmeta.com/ + use_official_api: false + require_api_key: false + results: HTML + - name: braveapi engine: braveapi # read https://docs.searxng.org/dev/engines/online/brave.html