From 71d1504e572074327f851688a4caac90a5e41fe8 Mon Sep 17 00:00:00 2001 From: Zhijie He Date: Sun, 23 Feb 2025 13:35:23 +0800 Subject: [feat] add 360search engine for searxng Co-authored-by: Bnyro --- searx/autocomplete.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'searx/autocomplete.py') diff --git a/searx/autocomplete.py b/searx/autocomplete.py index a0aa2a730..2ef6189a5 100644 --- a/searx/autocomplete.py +++ b/searx/autocomplete.py @@ -148,6 +148,21 @@ def mwmbl(query, _lang): return [result for result in results if not result.startswith("go: ") and not result.startswith("search: ")] +def qihu360search(query, _lang): + # 360Search search autocompleter + url = f"https://sug.so.360.cn/suggest?{urlencode({'format': 'json', 'word': query})}" + response = get(url) + + results = [] + + if response.ok: + data = response.json() + if 'result' in data: + for item in data['result']: + results.append(item['word']) + return results + + def seznam(query, _lang): # seznam search autocompleter url = 'https://suggest.seznam.cz/fulltext/cs?{query}' @@ -246,6 +261,7 @@ def yandex(query, _lang): backends = { + '360search': qihu360search, 'baidu': baidu, 'brave': brave, 'dbpedia': dbpedia, -- cgit v1.2.3