Reference
Provider Scripts
Provider logic lives in plain Python, so KRATOS stays generic. The engine invokes a script with an action and parameters, and reads one JSON object from stdout.
Invocation#
how the engine calls a script
python3 <script> action=<action> key=value key=value ...The script writes one JSON object to stdout. A non-zero exit with a message on stderr signals an error.
Actions#
| action | Expected output |
|---|---|
login | {"Status": "ok"} |
channels | {"Channels": [{"Id","Name","Logo"}, …]} |
vod · events · epg | {"Vod": […]} · {"Events": […]} · {"Epg": […]} |
manifest | {"Manifest": "<url>", "Headers": {…}} |
heartbeat | {"Status": "ok"} |
cdm | {"CdmAnswer": "…"} (license response, or kid:key,kid:key) |
pssh | {"ProcessedPssh": "…"} |
subtitles | {"Subtitles": "…"} |
The SDK#
Start from scripts/default.py, which is fully commented. The shared helper scripts/kratos.py provides parse_params, sessions that support bind, proxy, DoH or a custom DNS resolver, and a small client for KRATOS's own API.
Scripts are referenced per stream via the
Script and ScriptParams fields in a provider file — see Configuration → Providers.