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