[mod] engines: remove uses of enable_http2 = False

This has only been needed because we were flagged by HTTP2 fingerprinting.
Now, since we use curl cffi, we can bypass the fingerpinting, so we can
use HTTP2 just fine without getting blocked.
This commit is contained in:
Bnyro
2026-09-05 19:24:54 +02:00
parent 28b61729c7
commit 4781754dc4
6 changed files with 3 additions and 31 deletions

View File

@@ -37,17 +37,13 @@ about = {
}
categories = []
safeseach = True
safesearch = True
base_url = "https://luxxle.com"
luxxle_categ = "search"
"""Supported categories: "search", "news", "images", "videos"."""
# otherwise all requests get blocked (http2-fingerprinted probably)
enable_http2 = False
safe_search_map = {0: "Off", 1: "Moderate", 2: "Strict"}

View File

@@ -8,7 +8,7 @@ from urllib.parse import urlencode
from lxml import html
from searx.result_types import EngineResults
from searx.utils import eval_xpath_list, gen_useragent
from searx.utils import eval_xpath_list
from searx.enginelib import EngineCache
from searx.exceptions import SearxEngineAPIException, SearxEngineAccessDeniedException
from searx.network import get
@@ -44,8 +44,6 @@ SECRET_KEY_DB_KEY = "secret-key"
CACHE: EngineCache
"""Cache to store the secret API key for the engine."""
enable_http2 = False
def setup(engine_settings: dict[str, t.Any]) -> bool:
global CACHE # pylint: disable=global-statement
@@ -56,13 +54,7 @@ def setup(engine_settings: dict[str, t.Any]) -> bool:
def _get_secret_key():
resp = get(
base_url,
headers={
# circumvents Cloudflare bot protections
"User-Agent": gen_useragent(),
"Referer": base_url,
"Sec-GPC": "1",
"Connection": "keep-alive",
},
headers={"Referer": base_url},
)
if resp.status_code != 200:
@@ -105,8 +97,6 @@ def request(query, params):
params["headers"]["secret-key"] = secret_key
return params
def response(resp):
res = EngineResults()

View File

@@ -27,9 +27,6 @@ time_range_support = True
safesearch_map = {0: 'off', 1: '1', 2: '1'}
time_range_map = {'day': '1d', 'week': '1w', 'month': '1m', 'year': '1y'}
# using http2 returns forbidden errors
enable_http2 = False
def request(query, params):
args = {
@@ -50,8 +47,6 @@ def request(query, params):
# prevent automatic redirects to first page on pagination
params['allow_redirects'] = False
return params
def _image_result(result):
return {

View File

@@ -21,8 +21,6 @@ about = {
"require_api_key": False,
"results": "JSON",
}
# otherwise all requests get blocked, probably HTTP2 fingerprinting
enable_http2 = False
base_url = "https://stocksnap.io"
cdn_url = "https://cdn.stocksnap.io"

View File

@@ -17,12 +17,10 @@ about = {
categories = ['images', 'icons']
base_url = "https://uxwing.com"
enable_http2 = False
def request(query, params):
params['url'] = f"{base_url}/?s={quote_plus(query)}"
return params
def response(resp):

View File

@@ -30,8 +30,6 @@ web_base_url = "https://yep.com"
safesearch = True
safesearch_map = {0: "off", 1: "moderate", 2: "strict"}
enable_http2 = False
results_per_page = 20
_IMPORT_RE = re.compile(r"import\"(.*?)\";")
@@ -50,9 +48,6 @@ def request(query: str, params: "OnlineParams") -> None:
{
"Referer": f"{web_base_url}/",
"Origin": web_base_url,
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-site",
}
)