From 15862ebc35ceae6d87c4161f5dcd07b6ab31de4a Mon Sep 17 00:00:00 2001 From: Allen <64094914+allendema@users.noreply.github.com> Date: Sat, 16 Apr 2022 19:10:35 +0200 Subject: [PATCH 1/2] [mod] Pass desired ebay domain in settings https://www.ebay.de https://www.ebay.com htttps://www.ebay.es etc --- searx/engines/ebay.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/searx/engines/ebay.py b/searx/engines/ebay.py index b7aefcb44..07870f044 100644 --- a/searx/engines/ebay.py +++ b/searx/engines/ebay.py @@ -20,8 +20,10 @@ about = { categories = ['shopping'] paging = True -url = 'https://www.ebay.com' -search_url = url + '/sch/i.html?_nkw={query}&_sacat={pageno}' +# Set base_url in settings.yml in order to +# have the desired local TLD. +base_url = None +search_url = '/sch/i.html?_nkw={query}&_sacat={pageno}' results_xpath = '//li[contains(@class, "s-item")]' url_xpath = './/a[@class="s-item__link"]/@href' @@ -34,7 +36,7 @@ thumbnail_xpath = './/img[@class="s-item__image-img"]/@src' def request(query, params): - params['url'] = search_url.format(query=quote(query), pageno=params['pageno']) + params['url'] = f'{base_url}' + search_url.format(query=quote(query), pageno=params['pageno']) return params From f039873e1ac4fd2fd0f53b47e3a32b2b88793277 Mon Sep 17 00:00:00 2001 From: Allen <64094914+allendema@users.noreply.github.com> Date: Sun, 17 Apr 2022 10:37:12 +0200 Subject: [PATCH 2/2] [mod] Make a default domain for ebay Which can be changed. --- searx/settings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/searx/settings.yml b/searx/settings.yml index d6a465faf..2976f1c83 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -514,6 +514,7 @@ engines: # - name: ebay # engine: ebay # shortcut: eb + # base_url: 'https://www.ebay.com' # disabled: true # timeout: 5