Skip to main content

Python clean room implementation of a Torznab-compatible indexer proxy

Project description

Pyackett

A Python clean room implementation of a Torznab-compatible indexer proxy. Works as a standalone server (Sonarr/Radarr compatible) and as an importable Python library.

Loads Jackett's 550+ YAML indexer definitions directly. Includes browser-grade TLS fingerprinting and automatic Cloudflare Turnstile bypass.

Install

pip install pyackett

# With Cloudflare challenge support (adds Camoufox browser):
pip install pyackett[cloudflare]

Quick Start

As a server

# Download definitions from Jackett GitHub and start the server
pyackett --from-github jackett --port 9117

# With a SOCKS5 proxy
pyackett --from-github jackett --proxy socks5://user:pass@host:1080

# With local definitions
pyackett -d /path/to/definitions

Then point Sonarr/Radarr at http://localhost:9117/api/v2.0/indexers/{id}/results/torznab/ with the API key shown in the web UI.

As a Python library

import asyncio
from pyackett import Pyackett

async def main():
    pk = Pyackett(proxy="socks5://user:pass@host:1080")
    pk.load_definitions_from_github(source="jackett")

    await pk.configure_indexer("1337x", {})
    await pk.configure_indexer("therarbg", {})

    results = await pk.search("breaking bad", categories=[5000])
    for r in results:
        print(f"{r.title} | S:{r.seeders} | {r.size}")

    await pk.close()

asyncio.run(main())
# Synchronous wrapper for simple scripts
pk = Pyackett()
pk.load_definitions_from_github()
pk.configure_indexer("therarbg", {})
results = pk.search_sync("ubuntu")

Features

Torznab API

  • Full Torznab XML API compatible with Sonarr, Radarr, Prowlarr, qBittorrent
  • TorrentPotato JSON support
  • Capabilities endpoint per indexer
  • Multi-indexer search (/indexers/all/results/torznab/)

Cardigann YAML Engine

  • Loads all 550+ Jackett YAML indexer definitions
  • Go-style template engine ({{ if }}, {{ range }}, {{ eq }}, etc.)
  • CSS selector extraction (BeautifulSoup) and JSONPath
  • 25+ filter functions (replace, dateparse, fuzzytime, regexp, etc.)
  • 6 login methods (form, cookie, header/API key, GET, POST, captcha)

HTTP Client

  • curl_cffi with Chrome/Firefox TLS fingerprint impersonation
  • Built-in SOCKS5/SOCKS4/HTTP proxy support
  • Request delay per indexer definition
  • Automatic Cloudflare detection and bypass

Cloudflare Bypass (optional)

  • Automatic detection of Cloudflare 403/503 challenges
  • Camoufox (anti-detect Firefox) solves Turnstile challenges headlessly
  • Local HTTP CONNECT proxy bridges SOCKS5 auth for browsers
  • Firefox TLS fingerprint matching for cf_clearance cookie reuse
  • Cookies cached per domain for the session
  • Graceful fallback when Camoufox not installed (logs warning, skips CF sites)

Web UI

  • Bootstrap 5 dashboard at http://localhost:9117/
  • Browse and filter all 550+ available indexers
  • Dynamic configuration forms generated from YAML settings
  • Manual search with results table
  • Per-indexer Torznab URL copy, edit, test, delete

CLI Options

pyackett [OPTIONS]

  --host HOST               Bind address (default: 0.0.0.0)
  -p, --port PORT           Port (default: 9117)
  --config-dir DIR          Config/cache directory
  -d, --definitions-dir DIR Local YAML definitions directory
  --from-github {jackett,prowlarr}
                            Download definitions from GitHub
  --branch BRANCH           GitHub branch (default: master)
  --update-definitions      Force re-download definitions
  --proxy URL               Proxy (socks5://host:port, http://host:port)
  --api-key KEY             API key (auto-generated if not set)
  --log-level {DEBUG,INFO,WARNING,ERROR}

Architecture

pyackett/
  core/
    models.py          - ReleaseInfo, TorznabQuery, IndexerDefinition
    manager.py         - IndexerManager (load, configure, concurrent search)
    http.py            - curl_cffi client + Camoufox CF solver
    cache.py           - TTL result cache
    categories.py      - Torznab category mappings
    definitions_fetcher.py - GitHub tarball downloader
  engine/
    cardigann.py       - YAML definition interpreter
    template.py        - Go-style template engine
    filters.py         - 25+ data transformation filters
    selectors.py       - CSS + JSONPath extraction
  api/
    torznab.py         - Torznab XML generation + query parsing
  server/
    app.py             - FastAPI server + web UI
  pyackett.py          - Public library API
  cli.py               - CLI entry point

Development

git clone <repo>
cd pyackett
uv sync
uv run pytest tests/ -v

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyackett-0.3.2.tar.gz (177.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyackett-0.3.2-py3-none-any.whl (55.2 kB view details)

Uploaded Python 3

File details

Details for the file pyackett-0.3.2.tar.gz.

File metadata

  • Download URL: pyackett-0.3.2.tar.gz
  • Upload date:
  • Size: 177.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyackett-0.3.2.tar.gz
Algorithm Hash digest
SHA256 fe7fed976ac0a4c6f3fdebde955d5be085c9bda4c703a5df2e1929c86987fef3
MD5 6f61ac6bee84c951b85de1d8c79755d5
BLAKE2b-256 754b56e0952c7e94a891e0ec996d31351e6a949c62c7f4d4274d79aa26dd1bb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyackett-0.3.2.tar.gz:

Publisher: publish.yml on dmarkey/pyackett

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyackett-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: pyackett-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 55.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyackett-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1dff3be0f14b3b26e80bf32c04f34f91235f69d317a041a2a98ed4e070561450
MD5 a7d6a74cf107eb142a78ef06f310ced5
BLAKE2b-256 bb75964e067fd3dd9b2085f89761d85d94e7292e1c9f75e5abc80b347ef2c28e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyackett-0.3.2-py3-none-any.whl:

Publisher: publish.yml on dmarkey/pyackett

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page