Kryten playlist management service - handles video queue, playlist operations, and catalog enrichment with LLM
Project description
"# Kryten Playlist
Kryten playlist management service - handles video queue and playlist operations for CyTube.
Features
- Real-time playlist management
- Video queue operations
- Event-driven architecture using NATS
- Playlist synchronization
- Catalog Management: Ingest and enrich media catalogs with LLM-powered metadata
Installation
Prerequisites
- Python 3.10 or higher
- Poetry
- NATS server running
- kryten-py library
Setup
- Install dependencies:
poetry install
- Copy the example configuration:
cp config.example.json config.json
- Edit
config.jsonwith your settings:
{
"nats_url": "nats://localhost:4222",
"nats_subject_prefix": "kryten",
"service_name": "playlist"
}
Usage
Running the Service
Using Poetry:
poetry run kryten-playlist --config config.json
Using the startup script (PowerShell):
.\start-playlist.ps1
Using the startup script (Bash):
./start-playlist.sh
Catalog Management
Kryten Playlist includes tools to manage and enrich your media catalog.
Ingest
Ingest catalog from a MediaCMS instance:
# Using config file (recommended)
poetry run kryten-ingest --config config.json
# Or with manual arguments
poetry run kryten-ingest --base-url https://mediacms.example.com --db data/catalog.db
Enrich
Enrich metadata using LLM (OpenAI, Anthropic, OpenRouter, etc.):
# Enrich all unenriched items (recommended)
poetry run kryten-enrich --config config.json
# Manual enrichment with specific model
export LLM_API_KEY="your-key-here"
poetry run kryten-enrich --model gpt-4o --limit 100 --verify
Options:
--verify: Enable 2-pass verification (double-checks facts with LLM)--tv-only/--movies-only: Filter by type--dry-run: Preview changes without saving--force-all: Re-process items even if already enriched
Command Line Options
--config PATH: Path to configuration file (default:/etc/kryten/playlist/config.json)--log-level LEVEL: Set logging level (DEBUG, INFO, WARNING, ERROR)
Event Handling
The service currently listens for:
- queue: Video queue events
- delete: Video deletion events
- moveVideo: Video position changes
- setTemp: Temporary video status changes
Development
Running Tests
poetry run pytest
Linting
poetry run ruff check .
Formatting
poetry run black .
License
MIT License - see LICENSE file for details "
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kryten_playlist-0.3.2.tar.gz.
File metadata
- Download URL: kryten_playlist-0.3.2.tar.gz
- Upload date:
- Size: 76.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.11 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11bb92ec5149f1268a4ee91a572f85889f19125f9585b18cb60a723337cdc951
|
|
| MD5 |
8a95eb221e2f6ec4bfaa6210bda5340d
|
|
| BLAKE2b-256 |
fa39c584d488a77adb621067f8cbfefeac752758202bafc1b90c54bad012aaad
|
File details
Details for the file kryten_playlist-0.3.2-py3-none-any.whl.
File metadata
- Download URL: kryten_playlist-0.3.2-py3-none-any.whl
- Upload date:
- Size: 98.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.11 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2272c3c3f28aa5eff11c9e5c329a4641f79a35d602d644d67c47b4563cd57ed
|
|
| MD5 |
4b96249ad96e955d9e2b65d096f019bc
|
|
| BLAKE2b-256 |
a40eb9ab70f931c0addf9d71769a50b423edea886a3dfed4d82eaee7d3b23604
|