Cinemator (“cinema” + “torrent”) lets you instantly watch videos from any torrent magnet link.
Adding a torrent with one video starts HLS preparation immediately. Torrents with multiple videos wait for a file selection. Preparation continues on the server after the browser closes, and playback can begin as soon as the first HLS segments are available.
The torrent payload is temporary build input. Cinemator removes it after HLS preparation succeeds or fails. A completed HLS rendition is the retained media artifact: it remains available for seven days from completion, can be extended from the downloads list, and is removed only when it expires or is explicitly deleted. Cinemator does not impose an HLS size limit; available host storage is the operational limit.
Prerequisites:
- Docker
docker run -p 8000:8000 nlipatov/cinemator:latestOpen http://localhost:8000 in your browser.
Prerequisites:
- Go installed
- ffmpeg installed
cd src
go build
./cinematorOpen http://localhost:8000 in your browser.
docker buildx build -t cinemator ./src/cd src
go buildThe repository includes a Docker Compose setup with Caddy as the HTTPS reverse proxy.
Create an A record for the server's public IPv4 address. Add an AAAA record only when IPv6 is configured and reachable. Ports 80 and 443 must be reachable for Caddy to issue and renew the certificate. Port 42069 is published over TCP and UDP for torrent peers.
When using Cloudflare proxying, set the SSL/TLS encryption mode to Full (strict). DNS-only mode avoids Cloudflare proxy timeouts for slow torrent and HLS preparation requests.
cp .env.example .envSet DOMAIN in .env.
To enable the optional application password, generate a bcrypt hash:
docker run --rm -it caddy:2-alpine \
caddy hash-password --algorithm bcryptAt the prompts, enter and confirm the password you want to use. Caddy prints its bcrypt hash; store that hash, not the plaintext password, in .env.
Store the result in single quotes so Compose preserves the $ characters:
CINEMATOR_PASSWORD_HASH='$2a$14$...'Generate a session-signing secret:
openssl rand -base64 32Store it alongside the password hash:
CINEMATOR_SESSION_SECRET='...'Leave CINEMATOR_PASSWORD_HASH empty to keep Cinemator public. When password protection is enabled, CINEMATOR_SESSION_SECRET must contain at least 32 bytes. Password authentication is intended to be used over HTTPS.
Password login creates a seven-day session with up to three automatic renewals. A request to the protected application renews the session for another seven days when no more than one third of its lifetime remains. The renewal counter is signed into the cookie; sessions remain stateless. Once the renewal limit is reached, the cookie remains valid until it expires, and a password login is needed to reset the limit. Previous tokens remain valid until their own expiry, so a lost renewal response can be retried. Signing out clears the browser cookie; rotating the session secret invalidates all tokens.
QR sign-in inherits the approving session's expiry and renewal count, including on retries and when authorizing another device. It does not reset the session lifetime or renewal budget. Cinemator runs as a single-instance service, and pending QR sign-in requests are lost when it restarts.
The server accepts both legacy v1 cookies and new v2 cookies. Legacy cookies have no renewal counter and are treated as having used all renewals; they remain valid until their original expiry. QR sessions approved with a legacy cookie inherit that restriction. Older server versions cannot accept v2 cookies, so rolling back requires affected users to log in again.
docker compose config
docker compose pull
docker compose up -d
docker compose logs -f caddy cinematorCaddy obtains and renews the certificate automatically and redirects HTTP requests to HTTPS. Cinemator is reachable only through Caddy on port 8000; its runtime data is bind-mounted at /var/tmp/cinemator on the host. Compose creates that host directory when it does not exist.
To deploy a newer Cinemator image, update CINEMATOR_TAG if it is pinned, then run:
docker compose pull cinemator
docker compose up -d cinemator