-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
79 lines (55 loc) · 3.16 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
IMPORTANT NOTE: this project requires a custom version of tornado from
https://github.com/kzahel/tornado_gen that has a special
IOStream.read_chunk method. Please install this using virtualenv. If
you don't know how to use virtualenv, first learn about that.
SECONDARY NOTE: some features require a patched bencode
def bdecode(x,strict=True):
try:
r, l = decode_func[x[0]](x, 0)
except (IndexError, KeyError, ValueError):
raise BTFailure("not a valid bencoded string")
if l != len(x) and strict:
raise BTFailure("invalid bencoded value (data after valid prefix)")
return r
torrent client using tornado's ioloop.
fast and efficient for downloading files.
now downloads from non-100% complete peers
has support for ut_metadata extension
Behavior:
====
Accepts connections on options.port, and attempts to download from
anyone who connects on that port and sends a valid BitTorrent
handshake message. If the handshake message includes the extension
which supports sending the torrent metadata, it will request that
first.
Also with startup options it can initiate a connection to another
peer.
Running:
====
python -m ktorrent.serve
Testing:
====
try running uTorrent and with a torrent selected, go to the "peers"
pane, right click, "add peer" and enter the host:port (default port
8030) and start the torrent. You should see ktorrent start to download
pieces.
Other options:
====
- options.datapath - place to store torrent files and torrent data
- options.resume_file - place to store torrent metadata info (infohash
to .torrent file disk location mapping)
- options.startup_connect_to - give an ip:port and it will initiate a
handshake with this address, using either:
- options.startup_connect_torrent (a filesystem path of a .torrent file)
or
- options.startup_connet_to_hash (a 40 character hex torrent infohash)
- if options.startup_exit_on_close is specified, the program will quit
after the first peer connection closes.
Currently not very useful options:
====
- options.frontend_port - a web interface for controlling/observing
program behavior (has no functionality -- yet)
- options.static_path - where the web interface can serve static files
from (like html or images)
- options.template_path - where the web interface can serve template
files from (for html)