summaryrefslogtreecommitdiff
path: root/searx/engines/json_engine.py
diff options
context:
space:
mode:
authorAllen <64094914+allendema@users.noreply.github.com>2022-06-10 23:26:55 +0200
committerpi_searxng <pi@raspberrypi.local>2022-06-11 14:17:44 +0200
commitfd9a13a3e5a2b2725052a829b0027711d771b891 (patch)
tree3324af35746e92a6c647bd62ff055bf88f29c420 /searx/engines/json_engine.py
parent59ef9b9287f1beda12f7b9a20b93cbc378a22bac (diff)
downloadsearxng-fd9a13a3e5a2b2725052a829b0027711d771b891.tar.gz
searxng-fd9a13a3e5a2b2725052a829b0027711d771b891.zip
[enh] Initial no paging support for Yep.com
Upstream example query: https://yep.com/web?q=test https://yep.com/about
Diffstat (limited to 'searx/engines/json_engine.py')
-rw-r--r--searx/engines/json_engine.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/engines/json_engine.py b/searx/engines/json_engine.py
index f53bc0bf4..2dd3bc55e 100644
--- a/searx/engines/json_engine.py
+++ b/searx/engines/json_engine.py
@@ -16,6 +16,11 @@ paging = False
suggestion_query = ''
results_query = ''
+cookies = {}
+headers = {}
+'''Some engines might offer different result based on cookies or headers.
+Possible use-case: To set safesearch cookie or header to moderate.'''
+
# parameters for engines with paging support
#
# number of results on each page
@@ -88,6 +93,9 @@ def request(query, params):
if paging and search_url.find('{pageno}') >= 0:
fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num
+ params['cookies'].update(cookies)
+ params['headers'].update(headers)
+
params['url'] = search_url.format(**fp)
params['query'] = query