searxng/searxng · error · ValueError

missing torznab base_url

Error message

missing torznab base_url

What it means

Error "missing torznab base_url" thrown in searxng/searxng.

Source

Thrown at searx/engines/torznab.py:89

}
categories: list[str] = ['files']
paging: bool = False
time_range_support: bool = False

# defined in settings.yml
# example (Jackett): "http://localhost:9117/api/v2.0/indexers/all/results/torznab"
base_url: str = ''
api_key: str = ''
# https://newznab.readthedocs.io/en/latest/misc/api/#predefined-categories
torznab_categories: list[str] = []
show_torrent_files: bool = False
show_magnet_links: bool = True


def init(engine_settings=None):  # pylint: disable=unused-argument
    """Initialize the engine."""
    if len(base_url) < 1:
        raise ValueError('missing torznab base_url')


def request(query: str, params: dict[str, t.Any]) -> dict[str, t.Any]:
    """Build the request params."""
    search_url: str = base_url + '?t=search&q={search_query}'

    if len(api_key) > 0:
        search_url += '&apikey={api_key}'
    if len(torznab_categories) > 0:
        search_url += '&cat={torznab_categories}'

    params['url'] = search_url.format(
        search_query=quote(query), api_key=api_key, torznab_categories=",".join([str(x) for x in torznab_categories])
    )

    return params

View on GitHub (pinned to 9fea41204f)

When it happens

Trigger: Thrown at searx/engines/torznab.py:89 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of searxng/searxng@9fea41204f (2026-08-27). Data as JSON: /api/errors/e2aaed0d84e728f1. Report an issue: GitHub.