mirror of
https://github.com/searxng/searxng.git
synced 2024-12-25 02:30:29 +00:00
[fix] url encoding fix
This commit is contained in:
parent
7aa89ef7c6
commit
e1768ed292
1 changed files with 3 additions and 4 deletions
|
@ -1,17 +1,16 @@
|
||||||
from urllib import quote
|
|
||||||
from lxml import html
|
from lxml import html
|
||||||
from urlparse import urljoin
|
from urlparse import urljoin
|
||||||
from cgi import escape
|
from cgi import escape
|
||||||
|
from urllib import urlencode
|
||||||
|
|
||||||
categories = ['it']
|
categories = ['it']
|
||||||
|
|
||||||
base_url = 'http://stackoverflow.com/'
|
base_url = 'http://stackoverflow.com/'
|
||||||
search_url = base_url+'search?q='
|
search_url = base_url+'search?'
|
||||||
|
|
||||||
def request(query, params):
|
def request(query, params):
|
||||||
global search_url
|
global search_url
|
||||||
query = quote(query.replace(' ', '+'), safe='+')
|
params['url'] = search_url + urlencode({'q': query})
|
||||||
params['url'] = search_url + query
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue