Google: Fix URL quoting.

This commit is contained in:
Valentin Lorentz 2013-07-19 09:11:08 +00:00
parent 277f296057
commit 2a8b8e78a0

View File

@ -288,15 +288,13 @@ class Google(callbacks.PluginRegexp):
googleSnarfer = urlSnarfer(googleSnarfer) googleSnarfer = urlSnarfer(googleSnarfer)
def _googleUrl(self, s, channel): def _googleUrl(self, s, channel):
s = s.replace('+', '%2B') s = urllib.quote_plus(s)
s = s.replace(' ', '+')
url = r'http://%s/search?q=%s' % \ url = r'http://%s/search?q=%s' % \
(self.registryValue('baseUrl', channel), s) (self.registryValue('baseUrl', channel), s)
return url return url
def _googleUrlIG(self, s, channel): def _googleUrlIG(self, s, channel):
s = s.replace('+', '%2B') s = urllib.quote_plus(s)
s = s.replace(' ', '+')
url = r'http://%s/ig/calculator?hl=en&q=%s' % \ url = r'http://%s/ig/calculator?hl=en&q=%s' % \
(self.registryValue('baseUrl', channel), s) (self.registryValue('baseUrl', channel), s)
return url return url