SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] add missing scheme to duplicated results too ++ revert gigablasts handling
Adam Tauber37c3ace3096d
diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.pyindex 04513cc98..b852de9ba 100644--- a/searx/engines/gigablast.py+++ b/searx/engines/gigablast.py@@ -53,8 +53,6 @@ def response(resp):# parse resultsfor result in dom.xpath(results_xpath):url = result.xpath(url_xpath)[0].text- if not url.startswith('http://') and not url.startswith('https://'):- url = 'http://' + urltitle = result.xpath(title_xpath)[0].textcontent = escape(result.xpath(content_xpath)[0].text)diff --git a/searx/search.py b/searx/search.pyindex 899171242..f2b5235b8 100644--- a/searx/search.py+++ b/searx/search.py@@ -143,6 +143,10 @@ def score_results(results):res['parsed_url'] = urlparse(res['url'])+ # if the result has no scheme, use http as default+ if not res['parsed_url'].scheme:+ res['parsed_url'] = res['parsed_url']._replace(scheme="http")+res['host'] = res['parsed_url'].netlocif res['host'].startswith('www.'):@@ -206,9 +210,6 @@ def score_results(results):# if there is no duplicate found, append resultelse:res['score'] = score- # if the result has no scheme, use http as default- if res['parsed_url'].scheme == '':- res['parsed_url'] = res['parsed_url']._replace(scheme="http")results.append(res)