1 | It is assumed the reader is familiar with bencoding, as described in |
---|
2 | the BitTorrent protocol specification at |
---|
3 | http://www.bittorrent.org/protocol.html |
---|
4 | |
---|
5 | Dictionary keys used below will be enclosed in quotation marks, these |
---|
6 | are used for clarity and are not part of the actual key. |
---|
7 | |
---|
8 | The IPC protocol is used to allow processes to control or retrieve |
---|
9 | information from Transmission frontend, such as transmission-daemon, |
---|
10 | transmission-gtk or the MacOS X frontend. This communication is done |
---|
11 | over a unix-domain socket file such as |
---|
12 | ~/.transmission/daemon/socket. In this document the Transmission |
---|
13 | frontend will be referred to as the server and the process connecting |
---|
14 | to it as the client. |
---|
15 | |
---|
16 | Once a client connects to the server's socket, messages may be |
---|
17 | exchanged until either end closes the connection. Messages contain an |
---|
18 | 32-bit payload length, encoded as 8 bytes of ASCII hexidecimal, |
---|
19 | followed by the payload. Upper, lower, or mixed case for the length |
---|
20 | are all accpetable and must be handled correctly. Payload lengths |
---|
21 | greater than 2^31 - 8 (ie: 2147483640 decimal, 7FFFFFF8 hex) are not |
---|
22 | allowed. |
---|
23 | |
---|
24 | Bencoded messages will additionally be shown in the following format |
---|
25 | for better readability: |
---|
26 | str - "this is a string" |
---|
27 | num - 38795 |
---|
28 | list - ("wheeee", 435, "writing docs is boring") |
---|
29 | dict - {"name": "Josh", "beverage": "coffee", "quantity": "too damn much" } |
---|
30 | |
---|
31 | For version 1, the message payload is a bencoded dictionary, the |
---|
32 | valid keys and value formats for which are described below. Multiple |
---|
33 | keys may be used in one message. |
---|
34 | |
---|
35 | An example version 1 message: |
---|
36 | |
---|
37 | 0000000Ed4:porti9090ee |
---|
38 | {"port": 9090} |
---|
39 | |
---|
40 | For version 2 the message payload is a bencoded list containing a |
---|
41 | message id string followed by a bencoded value, the format of which is |
---|
42 | the same for version 1. The value may be followed by an optional |
---|
43 | bencoded integer, this is a message tag and is described in more |
---|
44 | detail below. |
---|
45 | |
---|
46 | An example version 2 message: |
---|
47 | |
---|
48 | 0000001El12:get-info-alll4:hashee |
---|
49 | ("get-info-all", ("hash")) |
---|
50 | |
---|
51 | The same message with a tag: |
---|
52 | |
---|
53 | 00000021l12:get-info-alll4:hashei5ee |
---|
54 | ("get-info-all", ("hash"), 5) |
---|
55 | |
---|
56 | Once the connection is made both the client and server must send a |
---|
57 | version 1 style message (ie: the payload is a dictionary and may not |
---|
58 | contain a tag) with the dictionary key "version" and a value formatted |
---|
59 | as described below. The version should be the first but not |
---|
60 | necessarily only key in the dictionary. Any other keys should be |
---|
61 | ignored and not processed as messages. Neither the client nor the |
---|
62 | server should wait to receive a version message before sending one, it |
---|
63 | must be sent immediately. No other messages should be sent until the |
---|
64 | version is received. |
---|
65 | |
---|
66 | The version value should be a bencoded dictionary containing two keys, |
---|
67 | "max" and "min". These are the minimum and maximum supported protocol |
---|
68 | versions, respectively. Communication will take place using the |
---|
69 | highest protocol version supported by both the client and the server, |
---|
70 | and is not possible at all if there is no common version. A client may |
---|
71 | receive a version value that is an integer instead of a dictionary |
---|
72 | with "min" and "max" keys. This deprecated version format indicates |
---|
73 | the only version supported by the server. |
---|
74 | |
---|
75 | The version dictionary may optionally contain a key "label". This is a |
---|
76 | human-readable name for the software, it is not machine-readable and |
---|
77 | neither servers nor clients should attempt to parse it. |
---|
78 | |
---|
79 | An example message containing minimum and maximum versions 1 and 2: |
---|
80 | |
---|
81 | 0000001Dd7:versiond3:mini1e3:maxi2eee |
---|
82 | {"version": {"min": 1, "max": 2}} |
---|
83 | |
---|
84 | Tagged messages, only supported in version 2, allow a client to tag a |
---|
85 | message with a positive non-zero integer. The server is then required |
---|
86 | to send a response to the message even if none would normally be |
---|
87 | required, and to tag the response with the same integer. When the |
---|
88 | server receives a tagged message it must send exactly one message back |
---|
89 | with the same tag. The client is allowed to use the same tag for |
---|
90 | multiple messages, even if a response to the first is not received |
---|
91 | before the second it sent. If a tagged message does not normally |
---|
92 | require a response then a "succeeded", "failed", "not-supported" or |
---|
93 | "bad-format" message will be sent back. |
---|
94 | |
---|
95 | An example tagged message and response: |
---|
96 | |
---|
97 | 00000010l5:startli8eei15ee |
---|
98 | ("start", (8), 15) |
---|
99 | 00000011l8:succeeded0:i15ee |
---|
100 | ("succeeded", "", 15) |
---|
101 | |
---|
102 | Some example sessions, including version handshake, are found at the |
---|
103 | end of this file. |
---|
104 | |
---|
105 | Dictionary keys are encoded in UTF-8 and case sensitive. Any character |
---|
106 | except a NUL (0x00) is valid. A server or client need not support |
---|
107 | every possible key and should silently ignore any that it does not |
---|
108 | understand. |
---|
109 | |
---|
110 | If a reference to a boolean is seen, it should be taken to mean an |
---|
111 | integer with a value of 0 representing false, 1 representing true, and |
---|
112 | any other value undefined. |
---|
113 | |
---|
114 | Individual torrents are identified by a unique integer. This integer |
---|
115 | is only valid for the current connection and may be invalid or refer |
---|
116 | to another torrent in a future connection. If a torrent is closed it's |
---|
117 | ID will never be reused to refer to another torrent for at least the |
---|
118 | duration of the connection. Negative integers or 0 are not valid IDs. |
---|
119 | |
---|
120 | A list of keys and the format of their values follows. Also listed is |
---|
121 | the minimum protocol version that the key may be used with. |
---|
122 | |
---|
123 | |
---|
124 | Key: "addfiles" |
---|
125 | Version: 1 |
---|
126 | Format: list of strings |
---|
127 | Replies: "succeeded", "failed", "not-supported", "bad-format", "info" |
---|
128 | Example: 8:addfilesl21:/torrents/foo.torrent20:/home/me/bar.torrente |
---|
129 | "addfiles", ("/torrents/foo.torrent", /home/me/bar.torrent") |
---|
130 | Details: Each string is the absolute path to a torrent metainfo file |
---|
131 | for the server to add. Note that whether or not the torrent |
---|
132 | metainfo file is copied (allowing the original to be moved or |
---|
133 | deleted safely) is implementation dependent and may not |
---|
134 | currently be known or changed with this protocol. |
---|
135 | |
---|
136 | Key: "addfile-detailed" |
---|
137 | Version: 2 |
---|
138 | Format: dict |
---|
139 | Replies: "succeeded", "failed", "not-supported", "bad-format", "info" |
---|
140 | Example: 16:addfile-detailedd4:file19:/tor/wooble.torrente |
---|
141 | "addfile-detailed", {"file": "/tor/wooble.torrent"} |
---|
142 | Details: Dictionary containing information about a torrent for the |
---|
143 | server to add. Valid keys include: |
---|
144 | "file" string, filename of torrent metainfo file |
---|
145 | "data" string, contents of a torrent metainfo file |
---|
146 | "directory" string, directory for data files for the torrent |
---|
147 | "autostart" boolean, start the torrent automatically |
---|
148 | Either "file" or "data" is required, but both are not allowed. |
---|
149 | |
---|
150 | Key: "automap" |
---|
151 | Version: 2 |
---|
152 | Format: boolean |
---|
153 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
154 | Example: 7:automapi1e |
---|
155 | "automap", 1 |
---|
156 | Details: Enable (1) or disable (0) automatic port mapping on the server. |
---|
157 | |
---|
158 | Key: "autostart" |
---|
159 | Version: 2 |
---|
160 | Format: boolean |
---|
161 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
162 | Example: 9:autostarti0e |
---|
163 | "autostart", 0 |
---|
164 | Details: Enable (1) or disable (0) automatic starting of new torrents |
---|
165 | added via "addfiles" or "addfiles-detailed" messages. |
---|
166 | |
---|
167 | Key: "bad-format" |
---|
168 | Version: 2 |
---|
169 | Format: value is ignored |
---|
170 | Replies: N/A |
---|
171 | Example: 10:bad-format0: |
---|
172 | "bad-format", "" |
---|
173 | Details: Sent in response to a tagged message which was structured |
---|
174 | incorrectly. For example, an "autostart" message with a |
---|
175 | string value might cause this message to be returned. |
---|
176 | |
---|
177 | Key: "directory" |
---|
178 | Version: 2 |
---|
179 | Format: string |
---|
180 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
181 | Example: 9:directory21:/home/roger/downloads |
---|
182 | "directory", "/home/roger/downloads" |
---|
183 | Details: Set the default directory used for any torrents added in the future. |
---|
184 | |
---|
185 | Key: "downlimit" |
---|
186 | Version: 2 |
---|
187 | Format: int |
---|
188 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
189 | Example: 9:downlimiti100e |
---|
190 | "downlimit", 100 |
---|
191 | Details: Set the server's download limit in kilobytes per second. |
---|
192 | Negative values are interpreted as no limit. |
---|
193 | |
---|
194 | Key: "failed" |
---|
195 | Version: 2 |
---|
196 | Format: string |
---|
197 | Replies: N/A |
---|
198 | Example: 6:failed17:permission denied |
---|
199 | "failed", "permission denied" |
---|
200 | Details: Sent in response to a tagged message to indicate failure. |
---|
201 | |
---|
202 | Key: "get-automap" |
---|
203 | Version: 2 |
---|
204 | Format: value is ignored |
---|
205 | Replies: "failed", "not-supported", "bad-format", "automap" |
---|
206 | Example: 11:get-automap0: |
---|
207 | "get-automap", "" |
---|
208 | Details: Requests that an "automap" message be sent back. |
---|
209 | |
---|
210 | Key: "get-autostart" |
---|
211 | Version: 2 |
---|
212 | Format: value is ignored |
---|
213 | Replies: "failed", "not-supported", "bad-format", "autostart" |
---|
214 | Example: 13:get-autostart0: |
---|
215 | "get-autostart", "" |
---|
216 | Details: Requests that an "autostart" message be sent back. |
---|
217 | |
---|
218 | Key: "get-directory" |
---|
219 | Version: 2 |
---|
220 | Format: value is ignored |
---|
221 | Replies: "failed", "not-supported", "bad-format", "directory" |
---|
222 | Example: 13:get-directory0: |
---|
223 | "get-directory", "" |
---|
224 | Details: Requests that an "directory" message be sent back. |
---|
225 | |
---|
226 | Key: "get-downlimit" |
---|
227 | Version: 2 |
---|
228 | Format: value is ignored |
---|
229 | Replies: "failed", "not-supported", "bad-format", "downlimit" |
---|
230 | Example: 13:get-downlimit0: |
---|
231 | "get-downlimit", "" |
---|
232 | Details: Requests that a "downlimit" message be sent back. |
---|
233 | |
---|
234 | Key: "get-info" |
---|
235 | Version: 2 |
---|
236 | Format: dict with keys "id" and "type" for lists of ints and strings |
---|
237 | Replies: "failed", "not-supported", "bad-format", "info" |
---|
238 | Example: 8:get-infod2:idli4ei7ei2ee4:typel4:hash4:nameee |
---|
239 | "get-info", {"id": (4, 7, 2), "type": ("hash", "name")} |
---|
240 | Details: Requests that the server send back an "info" message with |
---|
241 | info on all the torrent IDs in "id". The "type" key requests |
---|
242 | what info will be returned. See below for valid values to use |
---|
243 | here. Since the torrent ID is always included in an "info" |
---|
244 | message an empty or missing "type" key will cause only the ID |
---|
245 | to be returned. An "info" message will always be sent back, |
---|
246 | even if it is empty. |
---|
247 | |
---|
248 | Key: "get-info-all" |
---|
249 | Version: 2 |
---|
250 | Format: list of strings |
---|
251 | Replies: "failed", "not-supported", "bad-format", "info" |
---|
252 | Example: 12:get-info-alll4:hash4:namee |
---|
253 | "get-info-all", ("hash", "name") |
---|
254 | Details: Same as "getinfo" message with all torrent IDs specified. |
---|
255 | |
---|
256 | Key: "get-pex" |
---|
257 | Version: 2 |
---|
258 | Format: value is ignored |
---|
259 | Replies: "failed", "not-supported", "bad-format", "pex" |
---|
260 | Example: 7:get-pex0: |
---|
261 | "get-pex", "" |
---|
262 | Details: Requests that a "pex" message be sent back. |
---|
263 | |
---|
264 | Key: "get-port" |
---|
265 | Version: 2 |
---|
266 | Format: value is ignored |
---|
267 | Replies: "failed", "not-supported", "bad-format", "port" |
---|
268 | Example: 8:get-port0: |
---|
269 | "get-port", "" |
---|
270 | Details: Requests that a "port" message be sent back. |
---|
271 | |
---|
272 | Key: "get-status" |
---|
273 | Version: 2 |
---|
274 | Format: dict with keys "id" and "type" for lists of ints and strings |
---|
275 | Replies: "failed", "not-supported", "bad-format", "status" |
---|
276 | Example: 10:get-statusd2:idli4ei7ei2ee4:typel5:state9:completedee |
---|
277 | "get-status", {"id": (4, 7, 4), "type": ("state", "completed")} |
---|
278 | Details: Same as "get-info" message except status type strings are used |
---|
279 | instead and the server sends back a "status" message. |
---|
280 | |
---|
281 | Key: "get-status-all" |
---|
282 | Version: 2 |
---|
283 | Format: list of strings |
---|
284 | Replies: "failed", "not-supported", "bad-format", "status" |
---|
285 | Example: 14:get-status-alll5:state9:completede |
---|
286 | "get-status-all", ("state", "completed") |
---|
287 | Details: Same as "get-status" message with all torrent IDs specified. |
---|
288 | |
---|
289 | Key: "get-supported" |
---|
290 | Version: 2 |
---|
291 | Format: list of strings |
---|
292 | Replies: "failed", "not-supported", "bad-format", "supported" |
---|
293 | Example: 13:get-supportedl6:lookup8:get-port16:addfile-detailede |
---|
294 | "get-supported", ("lookup", "get-port", "addfile-detailed") |
---|
295 | Details: Request that a "supported" message be returned with whichever |
---|
296 | of the given message keys are supported. |
---|
297 | |
---|
298 | Key: "get-uplimit" |
---|
299 | Version: 2 |
---|
300 | Format: value is ignored |
---|
301 | Replies: "failed", "not-supported", "bad-format", "uplimit" |
---|
302 | Example: 11:get-uplimit0: |
---|
303 | "get-uplimit", "" |
---|
304 | Details: Requests that an "uplimit" message be sent back. |
---|
305 | |
---|
306 | Key: "lookup" |
---|
307 | Version: 2 |
---|
308 | Format: list of strings |
---|
309 | Replies: "failed", "not-supported", "bad-format", "info" |
---|
310 | Example: 6:lookupl40:0f16ea6965ee5133ea4dbb1e7f516e9fcf3d899ee |
---|
311 | "lookup", ("0f16ea6965ee5133ea4dbb1e7f516e9fcf3d899e") |
---|
312 | Details: Request that the server send back an "info" message with "id" |
---|
313 | and "hash" keys for any torrents with the given hashes. |
---|
314 | |
---|
315 | Key: "info" |
---|
316 | Version: 2 |
---|
317 | Format: list of dictionaries |
---|
318 | Replies: N/A |
---|
319 | Example: 4:infold2:idi3e4:name3:fooed2:idi9e4:name3:baree |
---|
320 | "info", ({"id": 4, "name": "foo"}, {"id": 9, "name": "bar"}) |
---|
321 | Details: A list containing information for several torrents. The |
---|
322 | dictionaries always contain at least an "id" key with the |
---|
323 | integer ID for the torrent, other possible values are listed |
---|
324 | below. |
---|
325 | |
---|
326 | Key: "noop" |
---|
327 | Version: 2 |
---|
328 | Format: value is ignored |
---|
329 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
330 | Example: 4:noop0: |
---|
331 | "noop", "" |
---|
332 | Details: This does nothing but keep the connection alive. With a tag |
---|
333 | it may be used as a ping. |
---|
334 | |
---|
335 | Key: "not-supported" |
---|
336 | Version: 2 |
---|
337 | Format: value is ignored |
---|
338 | Replies: N/A |
---|
339 | Example: 13:not-supported0: |
---|
340 | "not-supported", "" |
---|
341 | Details: Sent in response to a tagged message to indicated that the |
---|
342 | message was not supported. |
---|
343 | |
---|
344 | Key: "pex" |
---|
345 | Version: 2 |
---|
346 | Format: boolean |
---|
347 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
348 | Example: 3:pexi0e |
---|
349 | "pex", 0 |
---|
350 | Details: Enables or disables peer exchange. |
---|
351 | |
---|
352 | Key: "port" |
---|
353 | Version: 2 |
---|
354 | Format: int between 0 and 65535 |
---|
355 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
356 | Example: 4:porti9090e |
---|
357 | "port", 9090 |
---|
358 | Details: Change the port the server uses to listen for incoming peer |
---|
359 | connections. |
---|
360 | |
---|
361 | Key: "quit" |
---|
362 | Version: 1 |
---|
363 | Format: value is ignored |
---|
364 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
365 | Example: 4:quit0: |
---|
366 | "quit", "" |
---|
367 | Details: Cause the server to quit. Note that the connection might be |
---|
368 | closed without a response being sent. |
---|
369 | |
---|
370 | Key: "remove" |
---|
371 | Version: 2 |
---|
372 | Format: list of torrent ID ints |
---|
373 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
374 | Example: 5:removeli3ei8ei6ee |
---|
375 | "remove", (3, 8, 6) |
---|
376 | Details: Stop and remove the specified torrents. Note that whether or |
---|
377 | not the downloaded data or the original torrent files will be |
---|
378 | removed is implementation dependent and may not currently be |
---|
379 | known or changed with this protocol. If a saved copy of the |
---|
380 | torrent file has been made then it will always be deleted. |
---|
381 | |
---|
382 | Key: "remove-all" |
---|
383 | Version: 2 |
---|
384 | Format: value is ignored |
---|
385 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
386 | Example: 10:remove-all0: |
---|
387 | "remove-all", "" |
---|
388 | Details: Like "remove" with all torrent IDs specified. |
---|
389 | |
---|
390 | Key: "start" |
---|
391 | Version: 2 |
---|
392 | Format: list of torrent ID ints |
---|
393 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
394 | Example: 5:startli3ei8ei6ee |
---|
395 | "start", (3, 8, 6) |
---|
396 | Details: List of torrent IDs to start. |
---|
397 | |
---|
398 | Key: "start-all" |
---|
399 | Version: 2 |
---|
400 | Format: value is ignored |
---|
401 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
402 | Example: 9:start-all0: |
---|
403 | "start-all", "" |
---|
404 | Details: Start all torrents. |
---|
405 | |
---|
406 | Key: "status" |
---|
407 | Version: 2 |
---|
408 | Format: list of dictionaries |
---|
409 | Replies: N/A |
---|
410 | Example: 4:infold2:idi3e5:state7:seedinged2:idi9e5:state6:pausedee |
---|
411 | "info", ({"id": 3, "state": "seeding"}, {"id": 9, "state" : "paused"}) |
---|
412 | Details: Same as "info" message except status type keys are used. |
---|
413 | |
---|
414 | Key: "stop" |
---|
415 | Version: 2 |
---|
416 | Format: list of torrent ID ints |
---|
417 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
418 | Example: 4:stopli3ei8ei6ee |
---|
419 | "stop", (3, 8, 6) |
---|
420 | Details: List of torrent IDs to stop. |
---|
421 | |
---|
422 | Key: "stop-all" |
---|
423 | Version: 2 |
---|
424 | Format: value is ignored |
---|
425 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
426 | Example: 8:stop-all0: |
---|
427 | "stop-all", "" |
---|
428 | Details: Stop all torrents. |
---|
429 | |
---|
430 | Key: "succeeded" |
---|
431 | Version: 2 |
---|
432 | Format: value is ignored |
---|
433 | Replies: N/A |
---|
434 | Example: 8:succeeded0: |
---|
435 | "succeeded", "" |
---|
436 | Details: This is used to indicate that a tagged message was processed |
---|
437 | successfully. |
---|
438 | |
---|
439 | Key: "supported" |
---|
440 | Version: 2 |
---|
441 | Format: list of strings |
---|
442 | Replies: N/A |
---|
443 | Example: 9:supportedl8:get-port6:lookupe |
---|
444 | "supported", ("get-port", "lookup") |
---|
445 | Details: Sent in response to a "get-supported" message, indicates that |
---|
446 | the given messages ate supported. |
---|
447 | |
---|
448 | Key: "uplimit" |
---|
449 | Version: 2 |
---|
450 | Format: int |
---|
451 | Replies: "succeeded", "failed", "not-supported", "bad-format" |
---|
452 | Example: 7:uplimiti20e |
---|
453 | "uplimit", 20 |
---|
454 | Details: Set the server's upload limit in kilobytes per second. |
---|
455 | Negative values are interpreted as no limit. |
---|
456 | |
---|
457 | |
---|
458 | Info types for "get-info" and "info" messages. The only type for which |
---|
459 | support is mandatory is "id". |
---|
460 | |
---|
461 | "id" integer, torrent's ID for this connection |
---|
462 | "hash" SHA-1 info hash as a 40-char hex string |
---|
463 | "name" string, torrent name |
---|
464 | "path" string, path to .torrent file |
---|
465 | "saved" boolean, true if a copy of this torrent was saved |
---|
466 | "private" boolean, true if the torrent is private |
---|
467 | "trackers" a list of lists of dictionaries containing tracker info: |
---|
468 | "address" string, hostname or ip address of tracker |
---|
469 | "port" integer, port for tracker |
---|
470 | "announce" string, announce url on tracker |
---|
471 | "scrape" string, scrape url on tracker, may be absent |
---|
472 | "comment" string, comment from torrent file |
---|
473 | "creator" string, creator of torrent file |
---|
474 | "date" integer, date of torrent creation (unix time_t format) |
---|
475 | "size" integer, total size of all files in bytes |
---|
476 | "files" list of dictionaries for the files in this torrent: |
---|
477 | "name" string, name of file |
---|
478 | "size" integer, size of file in bytes |
---|
479 | |
---|
480 | |
---|
481 | Status types for "get-status" and "status" messages. The only type for |
---|
482 | which support is mandatory is "id". |
---|
483 | |
---|
484 | "completed" integer, bytes of data downloaded and verified |
---|
485 | "download-speed" integer, download speed in bytes per second |
---|
486 | "download-total" integer, total bytes downloaded so far |
---|
487 | "error" string, one of the following: |
---|
488 | "assert" something happened that shouldn't |
---|
489 | "io-parent" missing parent directory |
---|
490 | "io-permissions" filesystem permission error |
---|
491 | "io-space" not enough free space in filesystem |
---|
492 | "io-resource" insufficient resources |
---|
493 | "io-other" other filesystem i/o error |
---|
494 | "tracker-error" tracker returned error message |
---|
495 | "tracker-warning" tracker returned warning message |
---|
496 | "other" other error |
---|
497 | zero-length or missing string indicates no error |
---|
498 | "error-message" string, printable error message |
---|
499 | "eta" integer, estimated seconds until downloading is finished |
---|
500 | "id" integer, torrent's ID for this connection |
---|
501 | "peers-downloading" integer, peers downloading from us |
---|
502 | "peers-from" dict with the following int keys, peer connection sources: |
---|
503 | "incoming" peers connected to our listening port |
---|
504 | "tracker" peers discovered from tracker |
---|
505 | "cache" peers retrieved from on-disk cache |
---|
506 | "pex" peers discovered via peer exchange |
---|
507 | "peers-total" integer, total connected peers |
---|
508 | "peers-uploading" integer, peers uploading to us |
---|
509 | "running" boolean, false if torrent is stopped or stopping |
---|
510 | "state" string, one of the following: |
---|
511 | "checking" performing hash check on file data |
---|
512 | "downloading" downloading file data |
---|
513 | "seeding" seeding file data to peers |
---|
514 | "stopping" contacting tracker to send 'stopped' event |
---|
515 | "paused" torrent is not active |
---|
516 | "swarm-speed" integer, swarm speed in bytes per second |
---|
517 | "tracker" dict with the following keys, current active tracker |
---|
518 | "address" string, hostname or ip address of tracker |
---|
519 | "port" integer, port for tracker |
---|
520 | "announce" string, tracker announce url |
---|
521 | "scrape" string, tracker scrape url, may be absent |
---|
522 | "scrape-completed" integer, total completed peers as reported by tracker |
---|
523 | "scrape-leechers" integer, current leechers as reported by tracker |
---|
524 | "scrape-seeders" integer, current, seeders as reported by tracker |
---|
525 | "upload-speed" integer, upload speed in bytes per second |
---|
526 | "upload-total" integer, total bytes uploaded so far |
---|
527 | |
---|
528 | |
---|
529 | Examples: |
---|
530 | |
---|
531 | Data from the client to the server is prefixed with >>> and from |
---|
532 | server to client with <<<. These prefixes and newlines are added for |
---|
533 | clarity, they are not actually sent over the socket. |
---|
534 | |
---|
535 | Quit the server. Note that this is a version 1 client and so version 1 |
---|
536 | messages are used. |
---|
537 | >>> 0000001Dd7:versiond3:mini1e3:maxi1eee |
---|
538 | {"version", {"min": 1, "max": 1"}} |
---|
539 | <<< 0000001Dd7:versiond3:mini1e3:maxi2eee |
---|
540 | {"version", {"min": 1, "max": 2"}} |
---|
541 | >>> 0000000Bd4:quit0:e |
---|
542 | {"quit": ""} |
---|
543 | |
---|
544 | Pause all torrents and disable automapping. Note the server happens to |
---|
545 | have sent it's version before the client. The value for the stop-all |
---|
546 | message here is 5:fnord instead of 0: as used above, since the value |
---|
547 | is unused anything is allowed. |
---|
548 | <<< 0000001Dd7:versiond3:mini1e3:maxi2eee |
---|
549 | {"version", {"min": 1, "max": 2"}} |
---|
550 | >>> 0000001Dd7:versiond3:mini1e3:maxi2eee |
---|
551 | {"version", {"min": 1, "max": 2"}} |
---|
552 | >>> 0000000El8:stop-all5:fnorde |
---|
553 | ("stop-all", "fnord") |
---|
554 | |
---|
555 | Change upload and download limits with tagged responses. |
---|
556 | >>> 0000001Dd7:versiond3:mini1e3:maxi2eee |
---|
557 | {"version", {"min": 1, "max": 2"}} |
---|
558 | <<< 0000001Dd7:versiond3:mini1e3:maxi2eee |
---|
559 | {"version", {"min": 1, "max": 2"}} |
---|
560 | >>> 00000017l9:downlimiti100ei47el |
---|
561 | ("downlimit", 100, 47) |
---|
562 | >>> 00000017l9:uplimiti20ei48ee |
---|
563 | ("uplimit", 20, 48) |
---|
564 | <<< 00000014l8:succeeded0:i47ee |
---|
565 | ("succeeded", "", 47) |
---|
566 | <<< 00000014l8:succeeded0:i48ee |
---|
567 | (succeeded"", "", 48) |
---|
568 | |
---|
569 | Retrieve the upload and download limits. Note that the server has |
---|
570 | returned the responses in a different order than the requests were |
---|
571 | sent. The server is allowed to do this, a client should use tags if |
---|
572 | this is a concern. |
---|
573 | >>> 0000001Dd7:versiond3:mini1e3:maxi2eee |
---|
574 | {"version", {"min": 1, "max": 2"}} |
---|
575 | <<< 0000001Dd7:versiond3:mini1e3:maxi2eee |
---|
576 | {"version", {"min": 1, "max": 2"}} |
---|
577 | >>> 00000015l13:get-downlimiti0ee00000013l13:get-uplimiti0ee |
---|
578 | ("get-downlimit", 0) |
---|
579 | ("get-uplimit", 0) |
---|
580 | <<< 0000000Fl9:uplimiti20ee00000012l9:downlimiti100ee |
---|
581 | ("uplimit", 20) |
---|
582 | ("downlimit", 100) |
---|