From 7f1e2ba211a1bd8f2068aadddba5173440d28e36 Mon Sep 17 00:00:00 2001 From: Dalf Date: Sun, 7 Sep 2014 17:14:42 +0200 Subject: [PATCH] [enh] dailymotion engine: add language support --- searx/engines/dailymotion.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py index c1949cd70..75c2e5071 100644 --- 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'])