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:
@@ -9,7 +9,7 @@ import typing
|
||||
|
||||
import re
|
||||
from flask_babel import gettext
|
||||
from httpx import HTTPError
|
||||
from curl_cffi.requests.exceptions import RequestException
|
||||
|
||||
from searx.network import get
|
||||
from searx.plugins import Plugin, PluginInfo
|
||||
@@ -59,7 +59,7 @@ class SXNGPlugin(Plugin):
|
||||
resp = get(url_exit_list)
|
||||
node_list = re.findall(reg, resp.text) # type: ignore
|
||||
|
||||
except HTTPError:
|
||||
except RequestException:
|
||||
# No answer, return error
|
||||
msg = gettext("Could not download the list of Tor exit-nodes from")
|
||||
results.add(results.types.Answer(answer=f"{msg} {url_exit_list}"))
|
||||
|
||||
Reference in New Issue
Block a user