summaryrefslogtreecommitdiff
path: root/searx_extra
diff options
context:
space:
mode:
Diffstat (limited to 'searx_extra')
-rwxr-xr-xsearx_extra/update/update_engine_descriptions.py6
-rwxr-xr-xsearx_extra/update/update_external_bangs.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/searx_extra/update/update_engine_descriptions.py b/searx_extra/update/update_engine_descriptions.py
index 109fdbfa0..cf9007da3 100755
--- a/searx_extra/update/update_engine_descriptions.py
+++ b/searx_extra/update/update_engine_descriptions.py
@@ -10,7 +10,7 @@ from searx.engines.wikidata import send_wikidata_query
from searx.utils import extract_text
import searx
import searx.search
-import searx.poolrequests
+import searx.network
SPARQL_WIKIPEDIA_ARTICLE = """
SELECT DISTINCT ?item ?name
@@ -59,7 +59,7 @@ def get_wikipedia_summary(language, pageid):
search_url = 'https://{language}.wikipedia.org/api/rest_v1/page/summary/{title}'
url = search_url.format(title=quote(pageid), language=language)
try:
- response = searx.poolrequests.get(url)
+ response = searx.network.get(url)
response.raise_for_status()
api_result = json.loads(response.text)
return api_result.get('extract')
@@ -89,7 +89,7 @@ def get_website_description(url, lang1, lang2=None):
lang_list.append(lang2)
headers['Accept-Language'] = f'{",".join(lang_list)};q=0.8'
try:
- response = searx.poolrequests.get(url, headers=headers, timeout=10)
+ response = searx.network.get(url, headers=headers, timeout=10)
response.raise_for_status()
except Exception:
return (None, None)
diff --git a/searx_extra/update/update_external_bangs.py b/searx_extra/update/update_external_bangs.py
index e9dc0ff1d..e401e460a 100755
--- a/searx_extra/update/update_external_bangs.py
+++ b/searx_extra/update/update_external_bangs.py
@@ -17,7 +17,7 @@ import json
import re
from os.path import join
-import requests
+import httpx
from searx import searx_dir # pylint: disable=E0401 C0413
@@ -30,7 +30,7 @@ HTTP_COLON = 'http:'
def get_bang_url():
- response = requests.get(URL_BV1)
+ response = httpx.get(URL_BV1)
response.raise_for_status()
r = RE_BANG_VERSION.findall(response.text)
@@ -38,7 +38,7 @@ def get_bang_url():
def fetch_ddg_bangs(url):
- response = requests.get(url)
+ response = httpx.get(url)
response.raise_for_status()
return json.loads(response.content.decode())