mirror of https://github.com/searxng/searxng.git
Compare commits
5 Commits
b0e4a92894
...
caea14d4b4
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | caea14d4b4 | |
dependabot[bot] | 08384a312e | |
dependabot[bot] | 67f7548573 | |
dependabot[bot] | f40fc2dd4f | |
Markus Heiser | 10d3af84b8 |
|
@ -11,11 +11,11 @@ httpx[http2]==0.24.1
|
|||
Brotli==1.1.0
|
||||
uvloop==0.21.0
|
||||
httpx-socks[asyncio]==0.7.7
|
||||
setproctitle==1.3.3
|
||||
setproctitle==1.3.4
|
||||
redis==5.2.0
|
||||
markdown-it-py==3.0.0
|
||||
fasttext-predict==0.9.2.2
|
||||
tomli==2.0.2; python_version < '3.11'
|
||||
msgspec==0.18.6
|
||||
eval_type_backport; python_version < '3.9'
|
||||
typer-slim==0.13.0
|
||||
typer-slim==0.13.1
|
||||
|
|
|
@ -6,7 +6,7 @@ DuckDuckGo Lite
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
import re
|
||||
from urllib.parse import urlencode, quote_plus
|
||||
from urllib.parse import urlencode
|
||||
import json
|
||||
import babel
|
||||
import lxml.html
|
||||
|
@ -263,7 +263,7 @@ def request(query, params):
|
|||
|
||||
params['url'] = url
|
||||
params['method'] = 'POST'
|
||||
params['data']['q'] = quote_plus(query)
|
||||
params['data']['q'] = query
|
||||
|
||||
# The API is not documented, so we do some reverse engineering and emulate
|
||||
# what https://html.duckduckgo.com/html does when you press "next Page" link
|
||||
|
@ -381,7 +381,11 @@ def response(resp):
|
|||
zero_click_info_xpath = '//div[@id="zero_click_abstract"]'
|
||||
zero_click = extract_text(eval_xpath(doc, zero_click_info_xpath)).strip()
|
||||
|
||||
if zero_click and "Your IP address is" not in zero_click and "Your user agent:" not in zero_click:
|
||||
if zero_click and (
|
||||
"Your IP address is" not in zero_click
|
||||
and "Your user agent:" not in zero_click
|
||||
and "URL Decoded:" not in zero_click
|
||||
):
|
||||
current_query = resp.search_params["data"].get("q")
|
||||
|
||||
results.append(
|
||||
|
|
Loading…
Reference in New Issue