summaryrefslogtreecommitdiff
path: root/searx/engines/dailymotion.py
diff options
context:
space:
mode:
authorDalf <alex@al-f.net>2014-09-07 17:14:42 +0200
committerDalf <alex@al-f.net>2014-09-07 17:14:42 +0200
commit7f1e2ba211a1bd8f2068aadddba5173440d28e36 (patch)
tree02fb148d9f3d4187375178e4165a16ae842b827d /searx/engines/dailymotion.py
parentc23db1b2bfb2c9233816fc378927c49b67eeffaf (diff)
downloadsearxng-7f1e2ba211a1bd8f2068aadddba5173440d28e36.tar.gz
searxng-7f1e2ba211a1bd8f2068aadddba5173440d28e36.zip
[enh] dailymotion engine: add language support
Diffstat (limited to 'searx/engines/dailymotion.py')
-rw-r--r--searx/engines/dailymotion.py7
1 files changed, 6 insertions, 1 deletions
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'])