diff options
Diffstat (limited to 'searx/engines/wikipedia.py')
-rw-r--r-- | searx/engines/wikipedia.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.py index fe82f5115..6cd17e378 100644 --- a/searx/engines/wikipedia.py +++ b/searx/engines/wikipedia.py @@ -13,6 +13,7 @@ from json import loads from lxml.html import fromstring from searx.url_utils import quote, urlencode +from searx.utils import match_language # search-url base_url = u'https://{language}.wikipedia.org/' @@ -30,13 +31,7 @@ supported_languages_url = 'https://meta.wikimedia.org/wiki/List_of_Wikipedias' # set language in base_url def url_lang(lang): - lang = lang.split('-')[0] - if lang not in supported_languages: - language = 'en' - else: - language = lang - - return language + return match_language(lang, supported_languages).split('-')[0] # do search-request |