A simple IPTV wrapper for TorrServer that generates M3U8 playlists compatible with most IPTV players.
TorrServer's native playlist endpoint is not compatible with most IPTV players. TorrTV bridges this gap by providing standard M3U8 playlists.
name: 'torrtv'
version: '3'
services:
torrtv:
build:
context: .
dockerfile: Dockerfile
image: jarvisnexus/torrtv:latest
container_name: torrtv
ports:
- "3000:3000"
environment:
- PORT=3000
- TORRSERVER_URL=http://192.168.1.10:5665
- HOST=0.0.0.0
restart: alwaysRun with:
docker-compose up -dPORT- Server port (default: 3000)TORRSERVER_URL- Default TorrServer URL (default: http://192.168.1.10:5665)HOST- Server host (default: 0.0.0.0)
GET /torrents- List all torrentsGET /torrents/:hash- Get single torrentGET /playlist/all- M3U playlist for all torrentsGET /playlist/:hash- M3U playlist for specific torrent
TorrTV supports dynamic TorrServer URL configuration using the url query parameter. This allows you to generate playlists for different network environments without changing the server configuration.
Add ?url=<torrserver-url> to any endpoint:
http://192.168.1.10:3000/playlist/all?url=http://torrserver-url:5665
When accessing from your local network:
http://192.168.1.10:3000/playlist/all?url=http://192.168.1.10:5665
When connected via VPN with internal IP:
http://192.168.1.10:3000/playlist/all?url=http://10.8.0.5:5665
When accessing through a tunnel service:
http://192.168.1.10:3000/playlist/all?url=https://mytorrserver.example.com
When accessing from external network with port forwarding:
http://192.168.1.10:3000/playlist/all?url=http://123.45.67.89:5665
When using a custom domain:
http://192.168.1.10:3000/playlist/all?url=http://torrserver.mydomain.com:5665
http://192.168.1.10:3000/playlist/all?url=http://custom-torrserver:5665
http://192.168.1.10:3000/playlist/{hash}?url=http://custom-torrserver:5665
http://192.168.1.10:3000/torrents?url=http://custom-torrserver:5665
You can also pass the TorrServer URL via HTTP header:
curl -H "X-TorrServer-URL: http://custom-torrserver:5665" \
http://192.168.1.10:3000/playlist/allThe TorrServer URL is determined in this order:
- Query parameter
?url= - HTTP header
X-TorrServer-URL - Environment variable
TORRSERVER_URL
Create different playlist URLs for different scenarios:
At Home:
http://torrtv.local:3000/playlist/all?url=http://torrserver.local:5665
On Mobile (VPN):
http://torrtv.local:3000/playlist/all?url=http://10.8.0.5:5665
Away from Home (Tunnel):
http://torrtv.myserver.com:3000/playlist/all?url=https://torrserver-tunnel.myserver.com
Add the appropriate playlist URL to your IPTV player based on your current network:
TiviMate Example:
- Home:
http://192.168.1.10:3000/playlist/all?url=http://192.168.1.10:5665 - Away:
http://myserver.com:3000/playlist/all?url=https://tunnel.myserver.com
Add the playlist URL to your IPTV player:
Default TorrServer (from environment):
http://192.168.1.10:3000/playlist/all
Custom TorrServer URL:
http://192.168.1.10:3000/playlist/all?url=http://your-torrserver:5665
Or use a specific torrent:
http://192.168.1.10:3000/playlist/{hash}?url=http://your-torrserver:5665
MIT