Skip to main content

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)

Public API (third-party clients)

  • POST /api/public/v1/link — Exchange a one-time device code for an API key
  • GET /api/public/v1/current — Now playing
  • GET /api/public/v1/queue — Live queue with predicted start times
  • GET /api/public/v1/events — Upcoming scheduled events

Key-authenticated (Authorization: Bearer <key>) endpoints for Smart TV / tablet apps. Users link a device at /link. Full contract, JSON schemas, and a developer's guide: docs/PUBLIC_API.md.

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

Metadata

Release files for kryten-webqueue 0.51.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kryten-webqueue 0.51.1
File Size Uploaded Provenance Actions
kryten_webqueue-0.51.1.tar.gz 794.0 kB Without provenance Details for kryten_webqueue-0.51.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kryten-webqueue 0.51.1
File Interpreter ABI Platform Actions
kryten_webqueue-0.51.1-py3-none-any.whl Python 3 none any Details for kryten_webqueue-0.51.1-py3-none-any.whl

Total release size: 1.3 MB

Release files / kryten_webqueue-0.51.1.tar.gz

Download URL kryten_webqueue-0.51.1.tar.gz
Size 794.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5e57ce8eb735fc665284cbb5ddb3c8a2f419caffd92f70e834cae1e515c96778
BLAKE2b-256 checksum
How to use checksums
3cefc3b4e7e74526cb7aec96dfde9c785e3f25656c50aae9d95d320e18514b95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kryten_webqueue-0.51.1-py3-none-any.whl

Download URL kryten_webqueue-0.51.1-py3-none-any.whl
Size 534.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
730c1549b7a65f0366ae2e0b0aa56f4a11c301ad8801e029f74e148015c94e20
BLAKE2b-256 checksum
How to use checksums
169af5c94ae2d0f7113b9db84778201896c9e8a495e63631b459b33402f0c21f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Security for kryten-webqueue 0.51.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.51.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page