logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git
commit: 343e555ee96ab8b40b5ed4dce287331685eff3fa
parent 283f6c905340087d7511bfcdb815c0b4183bcdda
Author: Marc Abonce Seguin <marc-abonce@mailbox.org>
Date:   Sun,  8 Apr 2018 20:35:34 -0500

[fix] append http if no scheme is provided in xpath's extact_url

This solves a bug with Yahoo where some results don't specify
a protocol.

Diffstat:

Msearx/engines/xpath.py2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py @@ -53,7 +53,7 @@ def extract_url(xpath_results, search_url): if url.startswith('//'): # add http or https to this kind of url //example.com/ parsed_search_url = urlparse(search_url) - url = u'{0}:{1}'.format(parsed_search_url.scheme, url) + url = u'{0}:{1}'.format(parsed_search_url.scheme or 'http', url) elif url.startswith('/'): # fix relative url to the search engine url = urljoin(search_url, url)