mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 01:19:26 +01:00
Google: Decode URLs. Closes GH-1260.
This commit is contained in:
parent
866d95ca0b
commit
fa755c3a9c
@ -82,7 +82,7 @@ class Google(callbacks.PluginRegexp):
|
|||||||
results = []
|
results = []
|
||||||
for match in matches:
|
for match in matches:
|
||||||
r = dict(zip(('url', 'title', 'cacheUrl', 'content'), match))
|
r = dict(zip(('url', 'title', 'cacheUrl', 'content'), match))
|
||||||
r['url'] = utils.web.htmlToText(r['url'].split('&')[0])
|
r['url'] = utils.web.urlunquote(utils.web.htmlToText(r['url'].split('&')[0]))
|
||||||
results.append(r)
|
results.append(r)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
@ -54,6 +54,12 @@ class GoogleTestCase(ChannelPluginTestCase):
|
|||||||
# Unicode check
|
# Unicode check
|
||||||
self.assertNotError('google ae')
|
self.assertNotError('google ae')
|
||||||
|
|
||||||
|
def testUrlDecode(self):
|
||||||
|
self.assertRegexp(
|
||||||
|
'google site:http://www.urbandictionary.com carajo land',
|
||||||
|
'\x02Urban Dictionary: carajo land\x02: '
|
||||||
|
'https?://www.urbandictionary.com/define.php\?term=carajo%20land')
|
||||||
|
|
||||||
def testLucky(self):
|
def testLucky(self):
|
||||||
self.assertResponse('lucky Hacker News',
|
self.assertResponse('lucky Hacker News',
|
||||||
'https://news.ycombinator.com/')
|
'https://news.ycombinator.com/')
|
||||||
|
Loading…
Reference in New Issue
Block a user