MCPcopy Index your code
hub / github.com/YouROK/TorrServer

github.com/YouROK/TorrServer @MatriX.142

repository ↗ · DeepWiki ↗ · release MatriX.142 ↗ · Ask this repo → · + Follow
2,755 symbols 8,674 edges 265 files 118 documented · 4% updated 2d agoMatriX.142 · 2026-07-03★ 2,77724 open issues
README

Simple and powerful tool for streaming torrents.

GitHub Go Reference CodeFactor Build GitHub release (latest SemVer) GitHub tag (latest SemVer pre-release)

Introduction

TorrServer is a program that allows users to view torrents online without the need for preliminary file downloading. The core functionality of TorrServer includes caching torrents and subsequent data transfer via the HTTP protocol, allowing the cache size to be adjusted according to the system parameters and the user's internet connection speed.

AI Documentation

Ask DeepWiki

Features

  • Caching
  • Streaming
  • Local and Remote Server
  • Viewing torrents on various devices
  • Integration with other apps through API
  • Torznab search (Jackett, Prowlarr, and similar indexer managers)
  • Cross-browser modern web interface
  • Optional DLNA server
  • Optional GStreamer HLS transcoding support (-gst builds from release 141.10))

Getting Started

Installation

Download the application for the required platform in the releases page. After installation, open the link http://127.0.0.1:8090 in the browser.

Standard binaries are named TorrServer-<platform>-<arch> (for example, TorrServer-linux-amd64). From release 141.10, an optional GStreamer (gst) build is also available as TorrServer-gst-<platform>-<arch> with transcoding support (published for amd64 and arm64 only). The install scripts below can install either variant.

Windows

Run TorrServer-windows-amd64.exe.

Linux

Run in console

curl -s https://raw.githubusercontent.com/YouROK/TorrServer/master/installTorrServerLinux.sh | sudo bash

The script supports interactive and non-interactive installation, configuration, updates, and removal. When running the script interactively, you can:

  • Install/Update: Choose to install or update TorrServer
  • GStreamer build: For releases 141.10+ on amd64/arm64, choose the gst build with transcoding support (or pass --gst)
  • Reconfigure: If TorrServer is already installed, you'll be prompted to reconfigure settings (port, auth, read-only mode, logging, BBR)
  • Uninstall: Type Delete (or Удалить in Russian) to uninstall TorrServer

Download first and set execute permissions:

curl -s https://raw.githubusercontent.com/YouROK/TorrServer/master/installTorrServerLinux.sh -o installTorrServerLinux.sh && chmod 755 installTorrServerLinux.sh

Command-line examples:

  • Install a specific version:

bash sudo bash ./installTorrServerLinux.sh --install 135 --silent

  • Update to latest version:

bash sudo bash ./installTorrServerLinux.sh --update --silent

  • Install GStreamer build (141.10+):

bash sudo bash ./installTorrServerLinux.sh --install --gst sudo bash ./installTorrServerLinux.sh --update --gst --silent

  • Reconfigure settings interactively:

bash sudo bash ./installTorrServerLinux.sh --reconfigure

  • Check for updates:

bash sudo bash ./installTorrServerLinux.sh --check

  • Downgrade to a specific version:

bash sudo bash ./installTorrServerLinux.sh --down 135

  • Remove/uninstall:

bash sudo bash ./installTorrServerLinux.sh --remove --silent

  • Change the systemd service user:

bash sudo bash ./installTorrServerLinux.sh --change-user root --silent

All available commands:

  • --install [VERSION] - Install latest or specific version
  • --update - Update to latest version
  • --reconfigure - Reconfigure TorrServer settings (port, auth, read-only mode, logging, BBR)
  • --check - Check for updates (version info only)
  • --down VERSION - Downgrade to specific version
  • --remove - Uninstall TorrServer
  • --change-user USER - Change service user (root|torrserver)
  • --gst - Install GStreamer build with transcoding support (141.10+, amd64/arm64 only)
  • --root - Run service as root user
  • --silent - Non-interactive mode with defaults
  • --help - Show help message

macOS

Run in Terminal.app

curl -s https://raw.githubusercontent.com/YouROK/TorrServer/master/installTorrServerMac.sh -o installTorrserverMac.sh && chmod 755 installTorrServerMac.sh && bash ./installTorrServerMac.sh

The macOS install script supports the same commands as the Linux script, including --install, --update, --remove, --reconfigure, and --gst for the GStreamer build (141.10+).

Command-line examples:

  • Install latest version:

bash bash ./installTorrServerMac.sh --install

  • Install GStreamer build:

bash bash ./installTorrServerMac.sh --install --gst

  • Update silently:

bash bash ./installTorrServerMac.sh --update --silent

Alternative install script for Intel Macs: https://github.com/dancheskus/TorrServerMacInstaller

IOCage Plugin (Unofficial)

On FreeBSD (TrueNAS/FreeNAS) you can use this plugin: https://github.com/filka96/iocage-plugin-TorrServer

NAS Systems (Unofficial)

Server args

  • --port PORT, -p PORT - web server port (default 8090)
  • --ip IP, -i IP - web server addr (default empty, binds to all interfaces)
  • --ssl - enables https for web server
  • --sslport PORT - web server https port (default 8091). If not set, will be taken from db (if stored previously) or the default will be used.
  • --sslcert PATH - path to ssl cert file. If not set, will be taken from db (if stored previously) or default self-signed certificate/key will be generated.
  • --sslkey PATH - path to ssl key file. If not set, will be taken from db (if stored previously) or default self-signed certificate/key will be generated.
  • --force-https - with --ssl, the HTTP listener (--port) answers only with 307 Temporary Redirect to the same path on HTTPS (--sslport). The web UI and API are served on HTTPS only; nothing is served on HTTP except redirects. Requires --ssl (startup fails if --force-https is set without --ssl). Default is off so plain HTTP still works when SSL is disabled.
  • --path PATH, -d PATH - database and config dir path
  • --logpath LOGPATH, -l LOGPATH - server log file path
  • --weblogpath WEBLOGPATH, -w WEBLOGPATH - web access log file path
  • --rdb, -r - start in read-only DB mode
  • --httpauth, -a - enable http auth on all requests
  • --dontkill, -k - don't kill server on signal
  • --ui, -u - open torrserver page in browser
  • --torrentsdir TORRENTSDIR, -t TORRENTSDIR - autoload torrents from dir
  • --torrentaddr TORRENTADDR - Torrent client address (format [IP]:PORT, ex. :32000, 127.0.0.1:32768 etc)
  • --pubipv4 PUBIPV4, -4 PUBIPV4 - set public IPv4 addr
  • --pubipv6 PUBIPV6, -6 PUBIPV6 - set public IPv6 addr
  • --searchwa, -s - allow search without authentication
  • --maxsize MAXSIZE, -m MAXSIZE - max allowed stream size (in Bytes)
  • --tg TGTOKEN, -T TGTOKEN - Telegram bot token
  • --fuse FUSEPATH, -f FUSEPATH - fuse mount path
  • --webdav - enable web dav
  • --proxyurl PROXYURL - set proxy URL for BitTorrent traffic (http, socks4, socks5, socks5h), example: socks5h://user:password@example.com:2080
  • --proxymode PROXYMODE - set proxy mode: "tracker" (only HTTP trackers, default), "peers" (only peer connections), or "full" (all traffic)
  • --help, -h - display this help and exit
  • --version - display version and exit

Example:

TorrServer-darwin-arm64 [--port PORT] [--ip IP] [--path PATH] [--logpath LOGPATH] [--weblogpath WEBLOGPATH] [--rdb] [--httpauth] [--dontkill] [--ui] [--torrentsdir TORRENTSDIR] [--torrentaddr TORRENTADDR] [--pubipv4 PUBIPV4] [--pubipv6 PUBIPV6] [--searchwa] [--maxsize MAXSIZE] [--tg TGTOKEN] [--fuse FUSEPATH] [--webdav] [--ssl] [--sslport PORT] [--sslcert PATH] [--sslkey PATH] [--force-https]

Running in Docker & Docker Compose

Run in console

docker run --rm -d --name torrserver -p 8090:8090 ghcr.io/yourok/torrserver:latest

For running in persistence mode, just mount volume to container by adding -v ~/ts:/opt/ts, where ~/ts folder path is just example, but you could use it anyway... Result example command:

docker run --rm -d --name torrserver -v ~/ts:/opt/ts -p 8090:8090 ghcr.io/yourok/torrserver:latest

Environments

  • TS_HTTPAUTH - 1, and place auth file into ~/ts/config folder for enabling basic auth
  • TS_RDB - if 1, then the enabling --rdb flag
  • TS_DONTKILL - if 1, then the enabling --dontkill flag
  • TS_PORT - for changind default port to 5555 (example), also u need to change -p 8090:8090 to -p 5555:5555 (example)
  • TS_CONF_PATH - for overriding torrserver config path inside container. Example /opt/tsss
  • TS_TORR_DIR - for overriding torrents directory. Example /opt/torr_files
  • TS_LOG_PATH - for overriding log path. Example /opt/torrserver.log
  • TS_PROXYURL - set proxy URL for BitTorrent traffic (http, socks4, socks5, socks5h), example: socks5h://user:password@example.com:2080
  • TS_PROXYMODE - set proxy mode: "tracker" (only HTTP trackers, default), "peers" (only peer connections), or "full" (all traffic)

Example with full overrided command (on default values):

docker run --rm -d -e TS_PORT=5665 -e TS_DONTKILL=1 -e TS_HTTPAUTH=1 -e TS_RDB=1 -e TS_CONF_PATH=/opt/ts/config -e TS_LOG_PATH=/opt/ts/log -e TS_TORR_DIR=/opt/ts/torrents -e TS_PROXYURL=socks5h://user:password@example.com:2080 -e TS_PROXYMODE=tracker --name torrserver -v ~/ts:/opt/ts -p 5665:5665 ghcr.io/yourok/torrserver:latest

Docker Compose

# docker-compose.yml

version: '3.3'
services:
    torrserver:
        image: ghcr.io/yourok/torrserver
        container_name: torrserver
        network_mode: host    # to allow DLNA feature
        environment:
            - TS_PORT=5665
            - TS_DONTKILL=1
            - TS_HTTPAUTH=0
            - TS_CONF_PATH=/opt/ts/config
            - TS_TORR_DIR=/opt/ts/torrents
        volumes:
            - './CACHE:/opt/ts/torrents'
            - './CONFIG:/opt/ts/config'
        ports:
            - '5665:5665'
        restart: unless-stopped


Smart TV (using Media Station X)

  1. Install Media Station X on your Smart TV (see platform support)

  2. Open it and go to: Settings -> Start Parameter -> Setup

  3. Enter current ip and port of the TorrServe(r), e.g. 127.0.0.1:8090

Development

Go server

To run the Go server locally, just run

cd server
go run ./cmd

Web development

To run the web server locally, just run

yarn start

More info at https://github.com/YouROK/TorrServer/tree/master/web#readme

Build

Server

  • Install Golang 1.20+
  • Go to the TorrServer source directory
  • Run build script under linux or macOS build-all.sh

Web

  • Install npm and yarn
  • Go to the web directory
  • Run NODE_OPTIONS=--openssl-legacy-provider yarn build

Android

To build an Android server you will need the Android Toolchain.

Swagger

swag must be installed on the system to [re]build Swagger documentation.

go install github.com/swaggo/swag/cmd/swag@latest
cd server
swag init -g web/server.go --parseDependency --parseInternal --parseDepth 5

# Documentation can be linted using
swag fmt

Standard binaries serve a filtered Swagger spec at runtime (only /gst/settings); -gst builds include all /gst/* endpoints.

API

API Docs

API documentation is hosted as Swagger format available at path /swagger/index.html.

Authentication

The users data file should be located near to the settings. Basic auth, read more in wiki https://en.wikipedia.org/wiki/Basic_access_authentication.

accs.db in JSON format:

{
    "User1": "Pass1",
    "User2": "Pass2"
}

Note: You should enable authentication with -a (--httpauth) TorrServer startup option.

Whitelist/Blacklist IP

The lists file should be located in the same directory with config.db.

  • Whitelist file name: wip.txt
  • Blacklist file name: bip.txt

Whitelist has priority over everything else.

Example:

```text local:127.0.0.0-127.0.0.255 127.0.0.0-127.0.0.255 local:127.0.0.1 127.0.0.1

at the beginning of the line, comment

Extension points exported contracts — how you extend this code

INode (Interface)
(no doc) [4 implementers]
server/torrfs/node.go
TorrServerDB (Interface)
(no doc) [4 implementers]
server/settings/torrserverdb.go
Storage (Interface)
(no doc) [1 implementers]
server/torr/storage/storage.go
Ranger (Interface)
(no doc) [1 implementers]
server/web/blocker/iplist.go

Core symbols most depended-on inside this repo

n
called by 1375
server/web/pages/template/pages/static/js/2.70a31402.chunk.js
concat
called by 537
server/web/pages/template/pages/static/js/2.70a31402.chunk.js
tr
called by 425
server/tgbot/locales.go
t
called by 403
web/public/lord-icon-2.0.2.js
s
called by 247
server/web/pages/template/pages/static/js/2.70a31402.chunk.js
forEach
called by 201
server/web/pages/template/pages/static/js/2.70a31402.chunk.js
bind
called by 196
server/gstreamer/gst_api.go
r
called by 195
server/web/pages/template/pages/static/js/2.70a31402.chunk.js

Shape

Function 1,915
Method 673
Struct 104
Class 52
TypeAlias 6
Interface 5

Languages

TypeScript58%
Go42%

Modules by API surface

web/public/lord-icon-2.0.2.js427 symbols
server/web/pages/template/pages/lord-icon-2.0.2.js427 symbols
server/web/pages/template/pages/static/js/2.70a31402.chunk.js411 symbols
server/web/pages/template/pages/static/js/main.148b5dcb.chunk.js114 symbols
server/gstreamer/mp4box.go82 symbols
server/gstreamer/pipeline_gst.go49 symbols
server/gstreamer/probe.go47 symbols
server/gstreamer/service.go36 symbols
server/torrfs/fuse/fuse.go26 symbols
server/gstreamer/gst_api.go26 symbols
server/gstreamer/task.go22 symbols
server/torr/torrent.go19 symbols

Dependencies from manifests, versioned

github.com/KyleBanks/depthv1.2.1 · 1×
github.com/agnivade/levenshteinv1.2.1 · 1×
github.com/alecthomas/atomicv0.1.0-alpha2 · 1×
github.com/alexflint/go-scalarv1.2.0 · 1×
github.com/anacrolix/chansyncv0.7.0 · 1×
github.com/anacrolix/dht/v2v2.24.0 · 1×
github.com/anacrolix/dmsv1.7.2 · 1×
github.com/anacrolix/envpprofv1.5.0 · 1×
github.com/anacrolix/ffprobev1.1.0 · 1×
github.com/anacrolix/genericsv0.2.0 · 1×

For agents

$ claude mcp add TorrServer \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact