Skip to main content

Netflix/Tubi-style catalog browser and pay-to-play queue management for CyTube

Project description

kryten-webqueue

Netflix/Tubi-style catalog browser and pay-to-play queue management for CyTube.

Architecture

Browser → nginx (queue.dropsugar.co) → kryten-webqueue (:2010) → kryten-api-gate (:24444) → NATS services
  • HTTP-only — webqueue never touches NATS directly
  • SQLite for all local state (catalog, OTPs, queue shadow, playlists, schedules)
  • WebSocket for real-time queue updates
  • Polling api-gate every 3 seconds for playlist state

Quick Start

# Install
python -m venv .venv
.venv/bin/pip install -e .

# Configure
cp config.example.json /etc/kryten-webqueue/config.json
# Edit config.json with your secrets

# Run
WQ_CONFIG=/etc/kryten-webqueue/config.json python -m kryten_webqueue

Configuration

See config.example.json for all options. Required secrets:

Key Description
secret_key Random string for JWT signing (≥32 chars)
api_gate_token Bearer token for kryten-api-gate
mediacms_token API token for MediaCMS catalog sync

Deployment

# Install service
sudo cp deploy/kryten-webqueue.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now kryten-webqueue

# nginx
sudo cp deploy/nginx-queue.conf /etc/nginx/sites-available/queue.dropsugar.co
sudo ln -s /etc/nginx/sites-available/queue.dropsugar.co /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

API Endpoints

Auth

  • POST /auth/otp/request — Request OTP (delivered via PM)
  • POST /auth/otp/verify — Verify OTP, get session cookie
  • POST /auth/logout — Clear session
  • GET /auth/me — Current user info

Catalog

  • GET /catalog/browse — Paginated browse (with category filter)
  • GET /catalog/search?q=... — Full-text search
  • GET /catalog/item/{token} — Item detail
  • GET /catalog/categories — List categories

Queue

  • GET /queue/state — Current queue state
  • POST /queue/add — Add item (FIFO pay-queue)
  • POST /queue/playnext — Add as play-next (premium)
  • GET /queue/preview?friendly_token=...&tier=... — Cost preview
  • GET /queue/history — User's queue history

User

  • GET /user/balance — Economy balance
  • GET /user/transactions — Transaction history
  • GET /user/profile — Profile info

Admin (rank ≥ 3)

  • GET/POST/PUT/DELETE /admin/playlists/... — Saved playlists CRUD
  • GET/POST/PUT/DELETE /admin/schedules/... — Schedule CRUD
  • POST /admin/schedules/{id}/fire — Manual fire
  • POST /admin/queue/clear — Clear queue (refunds pay items)
  • DELETE /admin/queue/{uid} — Remove item
  • POST /admin/queue/sync-now — Trigger catalog sync

WebSocket

  • ws://host/ws — Real-time queue updates (auth via session cookie)

Dependencies

  • Python ≥ 3.12
  • kryten-api-gate ≥ 0.3.6
  • kryten-py ≥ 0.16.1 (upstream, not a direct dependency)
  • kryten-economy ≥ 0.8.11 (upstream, not a direct dependency)

License

Proprietary — DropSugar / Q&A

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_webqueue-0.1.1.tar.gz (80.9 kB view details)

Uploaded Source

Built Distribution

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

kryten_webqueue-0.1.1-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file kryten_webqueue-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for kryten_webqueue-0.1.1.tar.gz
Algorithm Hash digest
SHA256 89857959c8e70ef6180c1dbb88b8fa1c44f0e9f527551aaf59b47b71bae56342
MD5 3c7828a6c3e0a1e14a2a73a7a93a4e28
BLAKE2b-256 cb6ac47da9bb827fe100127ef01f2911e5db01f32ceaf72acda5bddb21b97d61

See more details on using hashes here.

File details

Details for the file kryten_webqueue-0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for kryten_webqueue-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfa3654408ea810492167e6bf6339e46251044dee97162b01cd7224a0d4a5b7b
MD5 745033e0172ca6f5e5de5692f181828c
BLAKE2b-256 b520b387770d05155ba07f200e69474e5d4e9b0f61ed843799d7d0dded67ed35

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