Skip to content

Simple BitTorrent download server controlled with REST API

License

Notifications You must be signed in to change notification settings

zhennik26/torrenttp

This branch is 9 commits behind glblduh/torrenttp:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f940ce7 · May 25, 2022

History

51 Commits
May 7, 2022
May 11, 2022
May 7, 2022
May 18, 2022
May 24, 2022
May 25, 2022
May 18, 2022
May 24, 2022
May 25, 2022
May 25, 2022
May 25, 2022
May 18, 2022

Repository files navigation

torrenttp

Simple REST API controlled BitTorrent client

Docker

docker run -d \
--name torrenttp \
-p 1010:1010 \ # Change the 1010 on the left to change the listening port
-v ~/tttpdl:/dl \ # Change the ~/tttpdl to the download path
-e NOUP=false \ # Set to true to disable uploads
--restart unless-stopped \
glbl/torrenttp:latest

Compiling

go mod download
go build -ldflags="-extldflags -static -w -s" -tags=nosqlite

Usage

torrenttp [-dir DOWNLOADDIR] [-port PORT] [-noup]

API

Add torrent

POST /api/addtorrent

For magnet link

{
    "magnet": "MAGNET_LINK"
}

For manual infohash, display name, and trackers

{
    "infohash": "INFOHASH",
    "displayname": "DISPLAY_NAME",
    "trackers": ["TRACKER_1", "TRACKER_2"]
}

Uploading a torrent file

POST /api/addtorrentfile

Attach the file in the torrent field in multipart/form-data

Selecting a file for download

POST /api/selectfile

{
    "infohash": "INFOHASH",
    "allfiles": false,
    "files": ["FILE_1", "FILE_2"]
}

Removing a torrent

DELETE /api/removetorrent

{
    "infohash": "INFOHASH",
    "removefiles": false
}

Streaming a file from torrent

GET /api/stream

/api/stream/:infohash/:filename

Download a file from torrent

GET /api/file

/api/file/:infohash/:filename

Getting torrent stats

GET /api/torrents

For all torrents

/api/torrents

For specific torrent

/api/torrents/:infohash

About

Simple BitTorrent download server controlled with REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 98.5%
  • Dockerfile 1.5%