diff options
author | Alice Ferrazzi <alice.ferrazzi@gmail.com> | 2018-08-12 22:22:25 +0900 |
---|---|---|
committer | Alice Ferrazzi <alice.ferrazzi@gmail.com> | 2018-08-12 23:00:57 +0900 |
commit | 5f0888b8f4f7a46a7418e6faf34d47d45adca1c7 (patch) | |
tree | 1c0d3329f546570418e5505fd1219d9fb2499499 /searx/engines/gentoo.py | |
parent | b7886bb15c35691e2db9089c4111c2fa2b685bed (diff) | |
download | searxng-5f0888b8f4f7a46a7418e6faf34d47d45adca1c7.tar.gz searxng-5f0888b8f4f7a46a7418e6faf34d47d45adca1c7.zip |
added languages to Gentoo engine
Diffstat (limited to 'searx/engines/gentoo.py')
-rw-r--r-- | searx/engines/gentoo.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/engines/gentoo.py b/searx/engines/gentoo.py index 4501b87ee..3611068d3 100644 --- a/searx/engines/gentoo.py +++ b/searx/engines/gentoo.py @@ -38,7 +38,7 @@ def locale_to_lang_code(locale): lang_urls = { 'en': { 'base': 'https://wiki.gentoo.org', - 'search': '/index.php?title=Special:Search&offset={offset}&{query}' + 'search': '/index.php?title=Special:Search&offset={offset}&{query}&profile=translation&languagefilter={language}' } } @@ -85,7 +85,7 @@ def request(query, params): # if our language is hosted on the main site, we need to add its name # to the query in order to narrow the results to that language if language in main_langs: - query += b' (' + main_langs[language] + b')' + query += b' (' + (main_langs[language]).encode('utf-8') + b')' # prepare the request parameters query = urlencode({'search': query}) @@ -95,7 +95,7 @@ def request(query, params): urls = get_lang_urls(language) search_url = urls['base'] + urls['search'] - params['url'] = search_url.format(query=query, offset=offset) + params['url'] = search_url.format(query=query, offset=offset, language=language) return params |