diff options
author | Matej Cotman <cotman.matej@gmail.com> | 2014-01-19 22:59:01 +0100 |
---|---|---|
committer | Matej Cotman <cotman.matej@gmail.com> | 2014-01-20 01:06:29 +0100 |
commit | dd4662978dd74c0dce089790689fe0a8a4f9bb16 (patch) | |
tree | f10d4c2cff38a66c01fe763ee666361ec6975581 /searx/engines/dailymotion.py | |
parent | b7fa79081f3c7c9ce2974c406e07b1e48cb9534a (diff) | |
download | searxng-dd4662978dd74c0dce089790689fe0a8a4f9bb16.tar.gz searxng-dd4662978dd74c0dce089790689fe0a8a4f9bb16.zip |
fix: robot fw, entry points, some flake8, package searx egg
Diffstat (limited to 'searx/engines/dailymotion.py')
-rw-r--r-- | searx/engines/dailymotion.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py index f8768ff53..7e0c922a9 100644 --- a/searx/engines/dailymotion.py +++ b/searx/engines/dailymotion.py @@ -8,9 +8,11 @@ locale = 'en_US' # see http://www.dailymotion.com/doc/api/obj-video.html search_url = 'https://api.dailymotion.com/videos?fields=title,description,duration,url,thumbnail_360_url&sort=relevance&limit=25&page=1&{query}' + def request(query, params): global search_url - params['url'] = search_url.format(query=urlencode({'search': query, 'localization': locale })) + params['url'] = search_url.format( + query=urlencode({'search': query, 'localization': locale})) return params @@ -32,6 +34,7 @@ def response(resp): results.append({'url': url, 'title': title, 'content': content}) return results + def text_content_from_html(html_string): desc_html = html.fragment_fromstring(html_string, create_parent=True) return desc_html.text_content() |