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.1.tar.gz (72.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.1-py3-none-any.whl (94.3 kB view details)

Uploaded Python 3

File details

Details for the file kryten_playlist-0.3.1.tar.gz.

File metadata

  • Download URL: kryten_playlist-0.3.1.tar.gz
  • Upload date:
  • Size: 72.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.1.tar.gz
Algorithm Hash digest
SHA256 0ee270feed20da8ad7c7f273ca8e2445c8c7c0c650ddcce417a7270c27ffe771
MD5 e35e4a4c56507804ff2b81a6faf59224
BLAKE2b-256 851d12374f9798f3cf9188c8f0f971ae29c1816bcea79b4ddbd630364fe6ab9b

See more details on using hashes here.

File details

Details for the file kryten_playlist-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: kryten_playlist-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 94.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c20693233f5a72447c93424074051bf135d00188f013bc16cba70decd3e42da7
MD5 b919a3c656d7217db3c15efaac8f8360
BLAKE2b-256 ca628f9f63a89a292a5adc04a058882d93c60d0a9018c71f99fedd611f586ff6

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