mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
[fix] gentoo: use mediawiki engine
This commit is contained in:
parent
54be8f09a6
commit
4eaa0dd275
3 changed files with 13 additions and 133 deletions
|
@ -100,6 +100,12 @@ base_url: str = 'https://{language}.wikipedia.org/'
|
|||
ISO 639-1 language code (en, de, fr ..) of the search language.
|
||||
"""
|
||||
|
||||
api_path: str = 'w/api.php'
|
||||
"""The path the PHP api is listening on.
|
||||
|
||||
The default path should work fine usually.
|
||||
"""
|
||||
|
||||
timestamp_format = '%Y-%m-%dT%H:%M:%SZ'
|
||||
"""The longhand version of MediaWiki time strings."""
|
||||
|
||||
|
@ -113,12 +119,7 @@ def request(query, params):
|
|||
else:
|
||||
params['language'] = params['language'].split('-')[0]
|
||||
|
||||
if base_url.endswith('/'):
|
||||
api_url = base_url + 'w/api.php?'
|
||||
else:
|
||||
api_url = base_url + '/w/api.php?'
|
||||
api_url = api_url.format(language=params['language'])
|
||||
|
||||
api_url = f"{base_url.rstrip('/')}/{api_path}?".format(language=params['language'])
|
||||
offset = (params['pageno'] - 1) * number_of_results
|
||||
|
||||
args = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue