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 cookiePOST /auth/logout— Clear sessionGET /auth/me— Current user info
Catalog
GET /catalog/browse— Paginated browse (with category filter)GET /catalog/search?q=...— Full-text searchGET /catalog/item/{token}— Item detailGET /catalog/categories— List categories
Queue
GET /queue/state— Current queue statePOST /queue/add— Add item (FIFO pay-queue)POST /queue/playnext— Add as play-next (premium)GET /queue/preview?friendly_token=...&tier=...— Cost previewGET /queue/history— User's queue history
User
GET /user/balance— Economy balanceGET /user/transactions— Transaction historyGET /user/profile— Profile info
Admin (rank ≥ 3)
GET/POST/PUT/DELETE /admin/playlists/...— Saved playlists CRUDGET/POST/PUT/DELETE /admin/schedules/...— Schedule CRUDPOST /admin/schedules/{id}/fire— Manual firePOST /admin/queue/clear— Clear queue (refunds pay items)DELETE /admin/queue/{uid}— Remove itemPOST /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 keyGET /api/public/v1/current— Now playingGET /api/public/v1/queue— Live queue with predicted start timesGET /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
Release files for kryten-webqueue 0.49.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kryten_webqueue-0.49.3.tar.gz | 687.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kryten_webqueue-0.49.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / kryten_webqueue-0.49.3.tar.gz
| Download URL | kryten_webqueue-0.49.3.tar.gz |
|---|---|
| Size | 687.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d51a0df56b08acbd01524c5688807823f26ebe8db204aa9b08cc20b1c0addc8d
|
|
BLAKE2b-256 checksum How to use checksums |
f7a7f0cdc497d7698471b376e27bd1c7872e868c356324f2bc9a7b4d851e3389
|
| 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.49.3-py3-none-any.whl
| Download URL | kryten_webqueue-0.49.3-py3-none-any.whl |
|---|---|
| Size | 470.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a25f16e66346211ed73d342e3ddaaa7afbfaabf30d45ca9978e48a2f1455a08
|
|
BLAKE2b-256 checksum How to use checksums |
e0e6c511e8a1540afa5844111e534dd81c7c90b9c84858484cc32059f5689981
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|