logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git
commit: 7f1e2ba211a1bd8f2068aadddba5173440d28e36
parent c23db1b2bfb2c9233816fc378927c49b67eeffaf
Author: Dalf <alex@al-f.net>
Date:   Sun,  7 Sep 2014 17:14:42 +0200

[enh] dailymotion engine: add language support

Diffstat:

Msearx/engines/dailymotion.py7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py @@ -16,8 +16,8 @@ from lxml import html # engine dependent config categories = ['videos'] -locale = 'en_US' paging = True +language_support = True # search-url # see http://www.dailymotion.com/doc/api/obj-video.html @@ -26,6 +26,11 @@ search_url = 'https://api.dailymotion.com/videos?fields=title,description,durati # do search-request def request(query, params): + if params['language'] == 'all': + locale = 'en-US' + else: + locale = params['language'] + params['url'] = search_url.format( query=urlencode({'search': query, 'localization': locale}), pageno=params['pageno'])