diff --git a/search.py b/search.py index 6c4615c027..f3ab03972e 100644 --- a/search.py +++ b/search.py @@ -127,6 +127,8 @@ def duck_search(query): query = query.replace('!', '') uri = 'http://duckduckgo.com/html/?q=%s&kl=uk-en' % query bytes = web.get(uri) + if 'web-result"' in bytes: #filter out the adds on top of the page + bytes = bytes.split('web-result"')[1] m = r_duck.search(bytes) if m: return web.decode(m.group(1))