diff options
| author | Zhijie He <hezhijie0327@hotmail.com> | 2025-02-23 13:35:23 +0800 |
|---|---|---|
| committer | Bnyro <bnyro@tutanota.com> | 2025-03-02 13:25:35 +0100 |
| commit | 71d1504e572074327f851688a4caac90a5e41fe8 (patch) | |
| tree | b5a7510936b1452c4c3d2b9b570d999ed58459e8 /searx/autocomplete.py | |
| parent | 80f5fad16e830a9fea9e73c0eaa5b36c27566d9c (diff) | |
[feat] add 360search engine for searxng
Co-authored-by: Bnyro <bnyro@tutanota.com>
Diffstat (limited to 'searx/autocomplete.py')
| -rw-r--r-- | searx/autocomplete.py | 16 |
1 files changed, 16 insertions, 0 deletions
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, |