diff options
author | marc <a01200356@itesm.mx> | 2016-08-05 23:34:56 -0500 |
---|---|---|
committer | marc <a01200356@itesm.mx> | 2016-12-13 19:32:00 -0600 |
commit | 149802c56926bf48520c98932c4c36b8152b3d2d (patch) | |
tree | f450a584a785c31a1c118be29b3039f779a0cb70 /searx/engines/duckduckgo_definitions.py | |
parent | e58949b76fac7aa93341523ff0e2f35e0a03e057 (diff) | |
download | searxng-149802c56926bf48520c98932c4c36b8152b3d2d.tar.gz searxng-149802c56926bf48520c98932c4c36b8152b3d2d.zip |
[enh] add supported_languages on engines and auto-generate languages.py
Diffstat (limited to 'searx/engines/duckduckgo_definitions.py')
-rw-r--r-- | searx/engines/duckduckgo_definitions.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py index 208ccca28..23a2f3be3 100644 --- a/searx/engines/duckduckgo_definitions.py +++ b/searx/engines/duckduckgo_definitions.py @@ -4,6 +4,7 @@ from re import compile, sub from lxml import html from searx.utils import html_to_text from searx.engines.xpath import extract_text +from searx.engines.duckduckgo import supported_languages url = 'https://api.duckduckgo.com/'\ + '?{query}&format=json&pretty=0&no_redirect=1&d=1' @@ -23,7 +24,7 @@ def result_to_text(url, text, htmlResult): def request(query, params): params['url'] = url.format(query=urlencode({'q': query})) - params['headers']['Accept-Language'] = params['language'] + params['headers']['Accept-Language'] = params['language'].split('-')[0] return params |