diff options
author | marc <a01200356@itesm.mx> | 2016-11-05 20:51:38 -0600 |
---|---|---|
committer | marc <a01200356@itesm.mx> | 2016-12-13 19:58:10 -0600 |
commit | f62ce21f50b540315a708ebfbf36878ddec9d1c4 (patch) | |
tree | 79f69b171e8d2d08fa30aa32a3592286622f9fcc /searx/engines/wikidata.py | |
parent | 92c6e88ad3e5ba57bd6e2ba64d0c38e8fd72ea09 (diff) | |
download | searxng-f62ce21f50b540315a708ebfbf36878ddec9d1c4.tar.gz searxng-f62ce21f50b540315a708ebfbf36878ddec9d1c4.zip |
[mod] fetch supported languages for several engines
utils/fetch_languages.py gets languages supported by each engine and
generates engines_languages.json with each engine's supported language.
Diffstat (limited to 'searx/engines/wikidata.py')
-rw-r--r-- | searx/engines/wikidata.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py index edb6d75fe..9c0a768e0 100644 --- a/searx/engines/wikidata.py +++ b/searx/engines/wikidata.py @@ -15,7 +15,7 @@ from searx import logger from searx.poolrequests import get from searx.engines.xpath import extract_text from searx.utils import format_date_by_locale -from searx.engines.wikipedia import supported_languages +from searx.engines.wikipedia import fetch_supported_languages from json import loads from lxml.html import fromstring @@ -57,7 +57,7 @@ calendar_name_xpath = './/sup[contains(@class,"wb-calendar-name")]' def request(query, params): - language = params['language'].split('_')[0] + language = params['language'].split('-')[0] if language == 'all': language = 'en' @@ -72,7 +72,7 @@ def response(resp): html = fromstring(resp.content) wikidata_ids = html.xpath(wikidata_ids_xpath) - language = resp.search_params['language'].split('_')[0] + language = resp.search_params['language'].split('-')[0] if language == 'all': language = 'en' |