i want to use python-libtorrent to get a list of peers connected to a torrent.
I have tried this code :
and it prints this:import libtorrent as lt
import time
ses = lt.session()
ses.listen_on(6881, 6891)
info = lt.torrent_info('test.torrent')
h = ses.add_torrent({'ti': info, 'save_path': './'})
print 'starting', h.name()
while (not h.is_seed()):
s = h.status()
p = h.get_peer_info()
print lt.peer_info().ip
sys.stdout.flush()
time.sleep(15)
print h.name(), 'complete'
so instead of giving me a peer list it gives me zeros.Am i doing something wrong?starting test.avi
('0.0.0.0', 0)
('0.0.0.0', 0)
.
.
.