Google: Fix URL formatting.

For some reason, it worked on Python 3…
This commit is contained in:
Valentin Lorentz 2016-05-05 08:31:04 +02:00
parent 6f1045ed20
commit 8321d8a547

View File

@ -92,7 +92,7 @@ class Google(callbacks.PluginRegexp):
return results return results
_gsearchUrl = 'https://www.google.com/search?gbv=2' _gsearchUrl = 'https://www.google.com/search'
@internationalizeDocstring @internationalizeDocstring
def search(self, query, channel, options={}): def search(self, query, channel, options={}):
"""Perform a search using Google's AJAX API. """Perform a search using Google's AJAX API.
@ -110,7 +110,7 @@ class Google(callbacks.PluginRegexp):
dynamic.irc.nick) dynamic.irc.nick)
headers = dict(utils.web.defaultHeaders) headers = dict(utils.web.defaultHeaders)
headers['Referer'] = ref headers['Referer'] = ref
opts = {'q': query} opts = {'q': query, 'gbv': '2'}
for (k, v) in options.items(): for (k, v) in options.items():
if k == 'smallsearch': if k == 'smallsearch':
if v: if v: