1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 12:10:11 +01:00

[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>
This commit is contained in:
Markus Heiser 2023-11-14 08:25:06 +01:00 committed by Markus Heiser
parent 2274d55d5a
commit 3829c253ff
5 changed files with 15 additions and 4 deletions

View File

@ -59,6 +59,9 @@ about = {
# engine dependent config # engine dependent config
categories = ['general', 'web'] categories = ['general', 'web']
paging = True paging = True
max_page = 200
"""200 pages maximum (``&first=1991``)"""
time_range_support = True time_range_support = True
safesearch = True safesearch = True
"""Bing results are always SFW. To get NSFW links from bing some age """Bing results are always SFW. To get NSFW links from bing some age

View File

@ -152,6 +152,10 @@ send_accept_language_header = True
paging = False paging = False
"""Brave only supports paging in :py:obj:`brave_category` ``search`` (UI """Brave only supports paging in :py:obj:`brave_category` ``search`` (UI
category All).""" 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 = True
safesearch_map = {2: 'strict', 1: 'moderate', 0: 'off'} # cookie: safesearch=off safesearch_map = {2: 'strict', 1: 'moderate', 0: 'off'} # cookie: safesearch=off

View File

@ -75,6 +75,10 @@ about = {
# engine dependent config # engine dependent config
categories = [] categories = []
paging = True paging = True
max_page = 5
"""5 pages maximum (``&p=5``): Trying to do more just results in an improper
redirect"""
qwant_categ = None qwant_categ = None
"""One of ``web-lite`` (or ``web``), ``news``, ``images`` or ``videos``""" """One of ``web-lite`` (or ``web``), ``news``, ``images`` or ``videos``"""
@ -112,10 +116,6 @@ def request(query, params):
args = {'q': query} args = {'q': query}
params['raise_for_httperror'] = False 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': if qwant_categ == 'web-lite':
url = web_lite_url + '?' url = web_lite_url + '?'

View File

@ -127,6 +127,9 @@ different to the UI language) and a region filter.
# engine dependent config # engine dependent config
categories = ['general', 'web'] categories = ['general', 'web']
paging = True paging = True
max_page = 18
"""Tested 18 pages maximum (argument ``page``), to be save max is set to 20."""
time_range_support = True time_range_support = True
safesearch = True safesearch = True

View File

@ -1871,6 +1871,7 @@ engines:
suggestion_xpath: //div[@class="top-info"]/p[@class="top-info spell"]/em/a suggestion_xpath: //div[@class="top-info"]/p[@class="top-info spell"]/em/a
first_page_num: 0 first_page_num: 0
page_size: 10 page_size: 10
max_page: 100
disabled: true disabled: true
about: about:
website: https://www.mojeek.com/ website: https://www.mojeek.com/