mirror of
https://github.com/searxng/searxng.git
synced 2026-09-11 16:56:05 +00:00
[mod] network: migrate to curl_cffi
This commit is contained in:
@@ -58,7 +58,7 @@ from json import loads
|
||||
from urllib.parse import urlencode
|
||||
from dateutil import parser
|
||||
|
||||
from httpx import DigestAuth
|
||||
from curl_cffi import CurlOpt
|
||||
|
||||
from searx.utils import html_to_text
|
||||
|
||||
@@ -141,7 +141,10 @@ def request(query, params):
|
||||
params["url"] = f"{_base_url()}/yacysearch.json?{urlencode(args)}"
|
||||
|
||||
if http_digest_auth_user and http_digest_auth_pass:
|
||||
params['auth'] = DigestAuth(http_digest_auth_user, http_digest_auth_pass)
|
||||
params['curl_options'] = {
|
||||
CurlOpt.HTTPAUTH: 2, # CURLAUTH_DIGEST
|
||||
CurlOpt.USERPWD: f"{http_digest_auth_user}:{http_digest_auth_pass}",
|
||||
}
|
||||
|
||||
return params
|
||||
|
||||
|
||||
Reference in New Issue
Block a user