summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2023-11-14 08:25:06 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2023-12-03 13:47:17 +0100
commit3829c253ff86eb169966c6b6e8c4247b774c68cb (patch)
tree9f091c84e5128f66a99940ba39dc42b9fa3f92dc
parent2274d55d5a4dea76b645e3495673545fea0fe529 (diff)
[mod] add option max_page to bing, brave, qwant, startpage & mojeek
[1] https://github.com/searxng/searxng/issues/2982#issuecomment-1808975780 Reported-by: @Damaj301damaj-lol [1] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
-rw-r--r--searx/engines/bing.py3
-rw-r--r--searx/engines/brave.py4
-rw-r--r--searx/engines/qwant.py8
-rw-r--r--searx/engines/startpage.py3
-rw-r--r--searx/settings.yml1
5 files changed, 15 insertions, 4 deletions
diff --git a/searx/engines/bing.py b/searx/engines/bing.py
index ae001ffa..ff15f0b2 100644
--- a/searx/engines/bing.py
+++ b/searx/engines/bing.py
@@ -59,6 +59,9 @@ about = {
# engine dependent config
categories = ['general', 'web']
paging = True
+max_page = 200
+"""200 pages maximum (``&first=1991``)"""
+
time_range_support = True
safesearch = True
"""Bing results are always SFW. To get NSFW links from bing some age
diff --git a/searx/engines/brave.py b/searx/engines/brave.py
index 1794cfc8..080de1b0 100644
--- a/searx/engines/brave.py
+++ b/searx/engines/brave.py
@@ -152,6 +152,10 @@ send_accept_language_header = True
paging = False
"""Brave only supports paging in :py:obj:`brave_category` ``search`` (UI
category All)."""
+max_page = 10
+"""Tested 9 pages maximum (``&offset=8``), to be save max is set to 10. Trying
+to do more won't return any result and you will most likely be flagged as a bot.
+"""
safesearch = True
safesearch_map = {2: 'strict', 1: 'moderate', 0: 'off'} # cookie: safesearch=off
diff --git a/searx/engines/qwant.py b/searx/engines/qwant.py
index 168eb860..1f8556cf 100644
--- a/searx/engines/qwant.py
+++ b/searx/engines/qwant.py
@@ -75,6 +75,10 @@ about = {
# engine dependent config
categories = []
paging = True
+max_page = 5
+"""5 pages maximum (``&p=5``): Trying to do more just results in an improper
+redirect"""
+
qwant_categ = None
"""One of ``web-lite`` (or ``web``), ``news``, ``images`` or ``videos``"""
@@ -112,10 +116,6 @@ def request(query, params):
args = {'q': query}
params['raise_for_httperror'] = False
- # all qwant engines (incl qwant-lite) delivers only 5 pages maximum
- if params['pageno'] > 5:
- return None
-
if qwant_categ == 'web-lite':
url = web_lite_url + '?'
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index 92d69867..15ebc6d0 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -127,6 +127,9 @@ different to the UI language) and a region filter.
# engine dependent config
categories = ['general', 'web']
paging = True
+max_page = 18
+"""Tested 18 pages maximum (argument ``page``), to be save max is set to 20."""
+
time_range_support = True
safesearch = True
diff --git a/searx/settings.yml b/searx/settings.yml
index 727b9534..828828b4 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -1871,6 +1871,7 @@ engines:
suggestion_xpath: //div[@class="top-info"]/p[@class="top-info spell"]/em/a
first_page_num: 0
page_size: 10
+ max_page: 100
disabled: true
about:
website: https://www.mojeek.com/