diff options
Diffstat (limited to 'searxng_extra/update/update_engine_descriptions.py')
-rwxr-xr-x | searxng_extra/update/update_engine_descriptions.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/searxng_extra/update/update_engine_descriptions.py b/searxng_extra/update/update_engine_descriptions.py index f3d6e7fa8..6052bf084 100755 --- a/searxng_extra/update/update_engine_descriptions.py +++ b/searxng_extra/update/update_engine_descriptions.py @@ -17,14 +17,11 @@ from os.path import join from lxml.html import fromstring -from langdetect import detect_langs -from langdetect.lang_detect_exception import LangDetectException - from searx.engines import wikidata, set_loggers from searx.utils import extract_text, match_language from searx.locales import LOCALE_NAMES, locales_initialize from searx import searx_dir -from searx.utils import gen_useragent +from searx.utils import gen_useragent, detect_language import searx.search import searx.network @@ -117,17 +114,6 @@ def get_wikipedia_summary(lang, pageid): return None -def detect_language(text): - try: - r = detect_langs(str(text)) # pylint: disable=E1101 - except LangDetectException: - return None - - if len(r) > 0 and r[0].prob > 0.95: - return r[0].lang - return None - - def get_website_description(url, lang1, lang2=None): headers = { 'User-Agent': gen_useragent(), |