mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
[fix] pep/flake8 compatibility
This commit is contained in:
parent
692c0bf5f0
commit
b2492c94f4
23 changed files with 197 additions and 109 deletions
|
@ -6,8 +6,11 @@ url = 'https://duckduckgo.com/'
|
|||
search_url = url + 'd.js?{query}&p=1&s=0'
|
||||
locale = 'us-en'
|
||||
|
||||
|
||||
def request(query, params):
|
||||
params['url'] = search_url.format(query=urlencode({'q': query, 'l': locale}))
|
||||
q = urlencode({'q': query,
|
||||
'l': locale})
|
||||
params['url'] = search_url.format(query=q)
|
||||
return params
|
||||
|
||||
|
||||
|
@ -17,8 +20,7 @@ def response(resp):
|
|||
for r in search_res:
|
||||
if not r.get('t'):
|
||||
continue
|
||||
results.append({'title': r['t']
|
||||
,'content': html_to_text(r['a'])
|
||||
,'url': r['u']
|
||||
})
|
||||
results.append({'title': r['t'],
|
||||
'content': html_to_text(r['a']),
|
||||
'url': r['u']})
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue