Skip to main content

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

  1. Install dependencies:
poetry install
  1. Copy the example configuration:
cp config.example.json config.json
  1. Edit config.json with 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

kryten_playlist-0.3.2.tar.gz (76.7 kB view details)

Uploaded Source

Built Distribution

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

kryten_playlist-0.3.2-py3-none-any.whl (98.3 kB view details)

Uploaded Python 3

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

Hashes for kryten_playlist-0.3.2.tar.gz
Algorithm Hash digest
SHA256 11bb92ec5149f1268a4ee91a572f85889f19125f9585b18cb60a723337cdc951
MD5 8a95eb221e2f6ec4bfaa6210bda5340d
BLAKE2b-256 fa39c584d488a77adb621067f8cbfefeac752758202bafc1b90c54bad012aaad

See more details on using hashes here.

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

Hashes for kryten_playlist-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2272c3c3f28aa5eff11c9e5c329a4641f79a35d602d644d67c47b4563cd57ed
MD5 4b96249ad96e955d9e2b65d096f019bc
BLAKE2b-256 a40eb9ab70f931c0addf9d71769a50b423edea886a3dfed4d82eaee7d3b23604

See more details on using hashes here.

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