.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1# SPDX-License-Identifier: AGPL-3.0-or-later
2""".. _botdetection src:
3
4Implementations used for bot detection.
5
6"""
7from __future__ import annotations
8
9__all__ = ["init", "dump_request", "get_network", "too_many_requests", "ProxyFix"]
10
11
12import valkey
13
14from ._helpers import dump_request
15from ._helpers import get_network
16from ._helpers import too_many_requests
17from . import config
18from . import valkeydb
19from .trusted_proxies import ProxyFix
20
21
22def init(cfg: config.Config, valkey_client: valkey.Valkey | None):
23 config.set_global_cfg(cfg)
24 if valkey_client:
25 valkeydb.set_valkey_client(valkey_client)
init(config.Config cfg, valkey.Valkey|None valkey_client)
Definition __init__.py:22