diff options
| author | Zhijie He <hezhijie0327@hotmail.com> | 2025-03-30 23:13:40 +0800 |
|---|---|---|
| committer | Bnyro <bnyro@tutanota.com> | 2025-03-31 14:59:49 +0200 |
| commit | 08885d0614f0b131a03f65af8bb4a601651dbacf (patch) | |
| tree | 8ce6fa0ee85a468f99aa3f0c8b019cfc512b7c8d /searx/autocomplete.py | |
| parent | 7b4612e86250389dc9d5ee67e4cc2cd64d06602a (diff) | |
[feat] add Quark autocomplete support
Co-authored-by: Bnyro <bnyro@tutanota.com>
Diffstat (limited to 'searx/autocomplete.py')
| -rw-r--r-- | searx/autocomplete.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/searx/autocomplete.py b/searx/autocomplete.py index 8a4f0a66a..ebe6972e3 100644 --- a/searx/autocomplete.py +++ b/searx/autocomplete.py @@ -164,6 +164,20 @@ def qihu360search(query, _lang): return results +def quark(query, _lang): + # Quark search autocompleter + url = f"https://sugs.m.sm.cn/web?{urlencode({'q': query})}" + response = get(url) + + results = [] + + if response.ok: + data = response.json() + for item in data.get('r', []): + results.append(item['w']) + return results + + def seznam(query, _lang): # seznam search autocompleter url = 'https://suggest.seznam.cz/fulltext/cs?{query}' @@ -286,6 +300,7 @@ backends = { 'duckduckgo': duckduckgo, 'google': google_complete, 'mwmbl': mwmbl, + 'quark': quark, 'qwant': qwant, 'seznam': seznam, 'sogou': sogou, |