diff options
author | Paolo Basso <12545838+paolobasso99@users.noreply.github.com> | 2023-06-25 17:24:28 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-06-29 09:32:57 +0200 |
commit | 7adb9090e5dbc25b0d120772beca01dc4eb0791e (patch) | |
tree | ebb4dca4e7aa6955b6fbacd91ae4720e3197ce62 /searx | |
parent | e5637fe7b98d7fb06cbbe0e0f24deb12a33187ba (diff) | |
download | searxng-7adb9090e5dbc25b0d120772beca01dc4eb0791e.tar.gz searxng-7adb9090e5dbc25b0d120772beca01dc4eb0791e.zip |
[mod] engine: Anna's Archive - add language support
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/annas_archive.py (renamed from searx/engines/annas-archive.py) | 9 | ||||
-rw-r--r-- | searx/settings.yml | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/searx/engines/annas-archive.py b/searx/engines/annas_archive.py index 56d1ca77a..1d5aa41ee 100644 --- a/searx/engines/annas-archive.py +++ b/searx/engines/annas_archive.py @@ -36,8 +36,13 @@ xpath_file_info: str = './/div[contains(@class, "text-xs")]' def request(query, params: Dict[str, Any]) -> Dict[str, Any]: - search_url: str = base_url + "/search?q={search_query}" - params["url"] = search_url.format(search_query=quote(query)) + search_url: str = base_url + "/search?q={search_query}&lang={lang}" + lang: str = "" + if params["language"] != "all": + lang = params["language"] + + params["url"] = search_url.format(search_query=quote(query), lang=lang) + print(params) return params diff --git a/searx/settings.yml b/searx/settings.yml index 561ec41a9..8877fba54 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -298,8 +298,8 @@ engines: disabled: true - name: anna's archive - engine: annas-archive - paging: False + engine: annas_archive + paging: false categories: files disabled: true shortcut: aa |