diff options
author | Bnyro <bnyro@tutanota.com> | 2024-07-02 20:43:23 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-07-03 10:24:03 +0200 |
commit | 4eaa0dd27580453a309185dd635ef6146ead63d4 (patch) | |
tree | ff9e6c7b5c92845e2158b21250a39b78ecc61d0f /searx/engines/mediawiki.py | |
parent | 54be8f09a62bd850017d661d2968ca012fc9c7a2 (diff) | |
download | searxng-4eaa0dd27580453a309185dd635ef6146ead63d4.tar.gz searxng-4eaa0dd27580453a309185dd635ef6146ead63d4.zip |
[fix] gentoo: use mediawiki engine
Diffstat (limited to 'searx/engines/mediawiki.py')
-rw-r--r-- | searx/engines/mediawiki.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py index 76317402e..81d0c37aa 100644 --- a/searx/engines/mediawiki.py +++ b/searx/engines/mediawiki.py @@ -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 = { |