mirror of
https://github.com/searxng/searxng.git
synced 2025-07-15 01:09:21 +02:00
[feat] engines: add Naver engine (#4573)
Some checks are pending
Documentation / Release (push) Waiting to run
Integration / Python 3.11 (push) Waiting to run
Integration / Python 3.12 (push) Waiting to run
Integration / Python 3.10 (push) Waiting to run
Integration / Python 3.13 (push) Waiting to run
Integration / Python 3.9 (push) Waiting to run
Integration / Theme (push) Waiting to run
Some checks are pending
Documentation / Release (push) Waiting to run
Integration / Python 3.11 (push) Waiting to run
Integration / Python 3.12 (push) Waiting to run
Integration / Python 3.10 (push) Waiting to run
Integration / Python 3.13 (push) Waiting to run
Integration / Python 3.9 (push) Waiting to run
Integration / Theme (push) Waiting to run
Refactor Naver engine (Web, News, Images, Videos, Autocomplete) - ref: https://search.naver.com/ - lang: `ko` - Wikidata: https://www.wikidata.org/wiki/Q485639 Co-authored-by: Bnyro <bnyro@tutanota.com>
This commit is contained in:
parent
365b9426f1
commit
156d1eb8c8
5 changed files with 256 additions and 18 deletions
|
@ -149,6 +149,21 @@ def mwmbl(query, _lang):
|
|||
return [result for result in results if not result.startswith("go: ") and not result.startswith("search: ")]
|
||||
|
||||
|
||||
def naver(query, _lang):
|
||||
# Naver search autocompleter
|
||||
url = f"https://ac.search.naver.com/nx/ac?{urlencode({'q': query, 'r_format': 'json', 'st': 0})}"
|
||||
response = get(url)
|
||||
|
||||
results = []
|
||||
|
||||
if response.ok:
|
||||
data = response.json()
|
||||
if data.get('items'):
|
||||
for item in data['items'][0]:
|
||||
results.append(item[0])
|
||||
return results
|
||||
|
||||
|
||||
def qihu360search(query, _lang):
|
||||
# 360Search search autocompleter
|
||||
url = f"https://sug.so.360.cn/suggest?{urlencode({'format': 'json', 'word': query})}"
|
||||
|
@ -300,6 +315,7 @@ backends = {
|
|||
'duckduckgo': duckduckgo,
|
||||
'google': google_complete,
|
||||
'mwmbl': mwmbl,
|
||||
'naver': naver,
|
||||
'quark': quark,
|
||||
'qwant': qwant,
|
||||
'seznam': seznam,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue