]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/torrent
merge
[plan9front.git] / sys / man / 1 / torrent
1 .TH TORRENT 1
2 .SH NAME
3 torrent \- bittorrent client
4 .SH SYNOPSIS
5 .B ip/torrent
6 [
7 .B -d
8 ] [
9 .B -v
10 ] [
11 .B -p
12 ] [
13 .B -m
14 .I mtpt
15 ] [
16 .B -t
17 .I tracker-url
18 ] [
19 .B -w
20 .I webseed-url
21 ] [
22 .B -s
23 ] [
24 .B -c
25 ] [
26 .B -i
27 .I peer-id
28 ] [
29 .B -A
30 .I user-agent
31 ] [
32 .I file
33 ]
34 .SH DESCRIPTION
35 BitTorrent is a protocol for efficient file distribution
36 over the internet. Files are split into small pieces
37 that are then downloaded by clients in random order.
38 As soon as a client completes a piece, it makes the piece 
39 available for others to download.
40 .PP
41 To find other clients (peers), a tracker-server is
42 contacted.
43 .PP
44 Before files can be transmitted, a torrent-file needs
45 to be created describing the pieces of the files and
46 other meta-data like network addresses of the trackers.
47 .PP
48 This is done with the
49 .B -c
50 option. If provided,
51 .I torrent
52 reads the file given at the final
53 .I file
54 argument (or standard-input when omitted) and writes
55 a torrent file to standard-output and exits.
56 A
57 .I tracker-url
58 should be given with the
59 .B -t
60 option in that case. A list of trackers can be obtained
61 on the web, see the examples below.
62 .PP
63 If the files in the torrent are also available from a url, a
64 .I webseed-url
65 can be passed with the
66 .B -w
67 option. If
68 .I webseed-url
69 ends with a slash, the filename, from the torrent, concatenated
70 with the url forms the target url.
71 .PP
72 Without the
73 .B -c
74 option,
75 .I torrent
76 downloads the files that are described in the torrent-file
77 given by the
78 .I file
79 argument to the current working directory. If no
80 .I file
81 is given, the torrent is read from standard-input.
82 .PP
83 Normally, the program exits immediately after all pieces
84 have been completed.
85 The
86 .B -s
87 option causes it to keep running and serve the remaining
88 clients (also known as seeding).
89 .PP
90 Trackers use a subset of the HTTP protocol, so an
91 alternative 
92 .IR webfs (4)
93 mountpoint can be given with the
94 .B -m
95 option (defaults to
96 .BR /mnt/web ).
97 .PP
98 The
99 .B -v
100 option causes
101 .I torrent
102 to list the files in the torrent-file before downloading.
103 .PP
104 The
105 .B -d
106 option produces verbose debug output to standard-error.
107 .PP
108 To monitor the download progress, the
109 .B -p
110 option can be given to cause the completed and total number of
111 pieces written as a line of text to standard-output in one
112 second intervals.
113 .PP
114 The
115 .B -i
116 option allows you to set the 20-byte
117 .I peer-id
118 that is sent to trackers and peers. If less than 20 bytes, the
119 .I peer-id
120 will be padded on the right with random ASCII numbers. The
121 .B -A
122 option allows setting the http 
123 .I user-agent
124 string that is used to contact the tracker. These options are
125 useful to fool trackers that filter clients based on the
126 .I peer-id
127 or
128 .I user-agent
129 .
130 .SH EXAMPLES
131 Create new torrent file
132 .EX
133 ip/torrent -t http://exodus.desync.com/announce \\
134         -c 9atom.iso >9atom.torrent
135 .EE
136 .LP
137 Download the latest iso file of the distribution 
138 .EX
139 cd /tmp
140 hget http://r-36.net/9front/9front.iso.bz2.torrent | \\
141         ip/torrent -pv | \\
142         aux/statusbar 'download...'
143 .EE
144 .LP
145 Get list of public alive trackers to choose from
146 .EX
147 hget http://www.trackon.org/api/live
148 .EE
149 .LP
150 .SH SOURCE
151 .B /sys/src/cmd/ip/torrent.c
152 .SH "SEE ALSO"
153 .IR hget (1),
154 .IR webfs (4)
155 .SH HISTORY
156 .I Torrent
157 first appeared in 9front (October, 2011).