summaryrefslogtreecommitdiff
path: root/searx/engines/yahoo.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2014-01-31 05:10:49 +0100
committerasciimoo <asciimoo@gmail.com>2014-01-31 05:10:49 +0100
commit68a08325241478df8374a8dd640d74648bdc4b72 (patch)
treea2725e8f0a83d4d7b35c78519b968a9d79675409 /searx/engines/yahoo.py
parent2a788c8f29f63bc069436f1a12343a47d66f2523 (diff)
downloadsearxng-68a08325241478df8374a8dd640d74648bdc4b72.tar.gz
searxng-68a08325241478df8374a8dd640d74648bdc4b72.zip
[enh] search language support upadtes
Diffstat (limited to 'searx/engines/yahoo.py')
-rw-r--r--searx/engines/yahoo.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/searx/engines/yahoo.py b/searx/engines/yahoo.py
index ab69bd6a9..2fbd785cf 100644
--- a/searx/engines/yahoo.py
+++ b/searx/engines/yahoo.py
@@ -17,8 +17,14 @@ paging = True
def request(query, params):
offset = (params['pageno'] - 1) * 10 + 1
+ if params['language'] == 'all':
+ language = 'en'
+ else:
+ language = params['language'].split('_')[0]
params['url'] = search_url.format(offset=offset,
query=urlencode({'p': query}))
+ params['cookies']['sB'] = 'fl=1&vl=lang_{lang}&sh=1&rw=new&v=1'\
+ .format(lang=language)
return params