2021-03-09 14:38:03 +03:00
2021-03-09 14:22:30 +03:00
2021-03-09 14:22:30 +03:00
2021-03-03 12:31:33 +03:00
2021-02-19 12:21:45 +03:00
2021-03-03 10:28:58 +03:00
2018-08-29 12:33:14 +03:00
2021-02-18 16:56:55 +03:00
2018-08-29 12:33:14 +03:00
2018-08-29 12:33:14 +03:00
2018-08-29 12:33:14 +03:00
2021-03-09 12:41:17 +03:00
2021-01-21 11:41:32 +03:00
2021-03-09 09:07:55 +03:00

TorrServer

TorrServer, stream torrent to http

Server args:

Usage

TorrServer [--port PORT] [--path PATH] [--logpath LOGPATH] [--rdb] [--httpauth] [--dontkill] [--ui]

Options

  • --port PORT, -p PORT web server port
  • --path PATH, -d PATH database and settings path
  • --logpath LOGPATH, -l LOGPATH log path
  • --rdb, -r start in read-only DB mode
  • --httpauth, -a http auth on all requests
  • --dontkill, -k dont kill server on signal
  • --ui, -u run page torrserver in browser
  • --version display version and exit

Http Api of TorrServer:

GET

/echo

Return version of server

/shutdown

Shutdown server

/stream...

args:

  • link - magnet/hash/link to torrent
  • index - index of file
  • preload - preload torrent
  • stat - return stat of torrent
  • save - save to db
  • m3u - return m3u
  • fromlast - return m3u from last play
  • play - start stream torrent
  • title - set title of torrent
  • poster - set poster link of torrent
Examples:

get stat

http://127.0.0.1:8090/stream/fname?link=...&stat

get m3u

http://127.0.0.1:8090/stream/fname?link=...&index=1&m3u http://127.0.0.1:8090/stream/fname?link=...&index=1&m3u&fromlast

stream torrent

http://127.0.0.1:8090/stream/fname?link=...&index=1&play http://127.0.0.1:8090/stream/fname?link=...&index=1&play&save http://127.0.0.1:8090/stream/fname?link=...&index=1&play&save&title=...&poster=...

only save

http://127.0.0.1:8090/stream/fname?link=...&save&title=...&poster=...

/playlistall/all.m3u

Get all http links of all torrents in m3u list

/playlist

Get http link of torrent in m3u list

args:

  • hash - hash of torrent
  • fromlast - from last play file

POST

/torrents
Send json:

{
"action": "add/get/rem/list/drop",
"link": "hash/magnet/link to torrent",
"hash": "hash of torrent",
"title": "title of torrent",
"poster": "link to poster of torrent",
"data": "custom data of torrent, may be json",
"save_to_db": true/false
}

Return json of torrent(s)
/torrent/upload
Send multipart/form data

Only one file support

args:

  • title - set title of torrent
  • poster - set poster link of torrent
  • data - set custom data of torrent, may be json
  • save - save to db
/cache
Send json:

{
"action": "get"
"hash" : ""hash": "hash of torrent",
}

Return cache stat

d36d0c28f8/server/torr/storage/state/state.go

/settings
Send json:

{
"action": "get/set/def",
fields of BTSets
}

Return json of BTSets

d36d0c28f8/server/settings/btsets.go

/viewed
Send json:

{
"action": "set/rem/list",
"hash": "hash of torrent",
"file_index": int, id of file,
}

Return

if hash is empty, return all viewed files
if hash is not empty, return viewed file of torrent

Json struct see in

d36d0c28f8/server/settings/viewed.go

Donate:

PayPal

YooMoney
YooMoney card: 5599 0050 6424 4747

SberBank card: 4276 4000 6707 2919

Thanks to everyone who tested and helped

Anacrolix Matt Joiner github.com/anacrolix
tsynik github.com/tsynik
Tw1cker Руслан Пахнев github.com/Nemiroff
SpAwN_LMG
Description
Torrent stream server
Readme GPL-3.0 88 MiB
Languages
JavaScript 76.3%
Go 14.6%
HTML 4.3%
Shell 3.7%
C# 0.7%
Other 0.4%