summaryrefslogtreecommitdiff
path: root/searx/engines/wikipedia.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2018-08-19 13:22:22 +0200
committerGitHub <noreply@github.com>2018-08-19 13:22:22 +0200
commitb75f1b6cc39a94989a74d52eb0f1267c3e3c665e (patch)
treed3bab81ca2071196b1b4223d6d2db7d408b79bf2 /searx/engines/wikipedia.py
parente7f7eda18cc69287f30c512a98b4e90453bcd8e7 (diff)
parent931c1bb0f663bc13998f5a78ae7cd9485d37453c (diff)
downloadsearxng-b75f1b6cc39a94989a74d52eb0f1267c3e3c665e.tar.gz
searxng-b75f1b6cc39a94989a74d52eb0f1267c3e3c665e.zip
Merge branch 'master' into patch-2
Diffstat (limited to 'searx/engines/wikipedia.py')
-rw-r--r--searx/engines/wikipedia.py9
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