mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
Google: Fixes.
This commit is contained in:
parent
f8aaddd5b5
commit
6f1045ed20
@ -92,7 +92,7 @@ class Google(callbacks.PluginRegexp):
|
||||
return results
|
||||
|
||||
|
||||
_gsearchUrl = 'https://www.google.com/search?gbv=1'
|
||||
_gsearchUrl = 'https://www.google.com/search?gbv=2'
|
||||
@internationalizeDocstring
|
||||
def search(self, query, channel, options={}):
|
||||
"""Perform a search using Google's AJAX API.
|
||||
@ -110,7 +110,7 @@ class Google(callbacks.PluginRegexp):
|
||||
dynamic.irc.nick)
|
||||
headers = dict(utils.web.defaultHeaders)
|
||||
headers['Referer'] = ref
|
||||
opts = {'q': query, 'v': '1.0'}
|
||||
opts = {'q': query}
|
||||
for (k, v) in options.items():
|
||||
if k == 'smallsearch':
|
||||
if v:
|
||||
@ -120,10 +120,10 @@ class Google(callbacks.PluginRegexp):
|
||||
elif k == 'filter':
|
||||
opts['safe'] = v
|
||||
elif k == 'language':
|
||||
opts['lr'] = v
|
||||
opts['hl'] = v
|
||||
defLang = self.registryValue('defaultLanguage', channel)
|
||||
if 'lr' not in opts and defLang:
|
||||
opts['lr'] = defLang
|
||||
if 'hl' not in opts and defLang:
|
||||
opts['hl'] = defLang.strip('lang_')
|
||||
if 'safe' not in opts:
|
||||
opts['safe'] = self.registryValue('searchFilter', dynamic.channel)
|
||||
if 'rsz' not in opts:
|
||||
|
Loading…
Reference in New Issue
Block a user