{"record":{"id":"e2aaed0d84e728f1","repo":"searxng/searxng","slug":"missing-torznab-base-url","errorCode":null,"errorMessage":"missing torznab base_url","messagePattern":"missing torznab base_url","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"searx/engines/torznab.py","lineNumber":89,"sourceCode":"}\ncategories: list[str] = ['files']\npaging: bool = False\ntime_range_support: bool = False\n\n# defined in settings.yml\n# example (Jackett): \"http://localhost:9117/api/v2.0/indexers/all/results/torznab\"\nbase_url: str = ''\napi_key: str = ''\n# https://newznab.readthedocs.io/en/latest/misc/api/#predefined-categories\ntorznab_categories: list[str] = []\nshow_torrent_files: bool = False\nshow_magnet_links: bool = True\n\n\ndef init(engine_settings=None):  # pylint: disable=unused-argument\n    \"\"\"Initialize the engine.\"\"\"\n    if len(base_url) < 1:\n        raise ValueError('missing torznab base_url')\n\n\ndef request(query: str, params: dict[str, t.Any]) -> dict[str, t.Any]:\n    \"\"\"Build the request params.\"\"\"\n    search_url: str = base_url + '?t=search&q={search_query}'\n\n    if len(api_key) > 0:\n        search_url += '&apikey={api_key}'\n    if len(torznab_categories) > 0:\n        search_url += '&cat={torznab_categories}'\n\n    params['url'] = search_url.format(\n        search_query=quote(query), api_key=api_key, torznab_categories=\",\".join([str(x) for x in torznab_categories])\n    )\n\n    return params\n\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/searxng/searxng/blob/9fea41204fdfa7a5cfa15b0ebd12904c520478ce/searx/engines/torznab.py#L71-L107","documentation":"Error \"missing torznab base_url\" thrown in searxng/searxng.","triggerScenarios":"Thrown at searx/engines/torznab.py:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9fea41204fdfa7a5cfa15b0ebd12904c520478ce","analyzedAt":"2026-08-27T06:40:00.395Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}