mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
fix: robot fw, entry points, some flake8, package searx egg
This commit is contained in:
parent
b7fa79081f
commit
dd4662978d
17 changed files with 293 additions and 130 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue