Page 1 of 1

Check Seeds/Peers on a UDP tracker

Posted: Thu Oct 13, 2011 6:44 pm
by shadyabhi
I am trying to find the seeds/peers from a UDP tracker but I have not been successful in doing it.
Protocol description -> http://bittorrent.org/beps/bep_0015.htm ... r-protocol

Code: Select all

import struct
import socket
import random

clisocket =  socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
packet = "\x00\x00\x04\x17\x27\x10\x19\x80"
transaction_id = random.randrange(1,65535)
print transaction_id
packet = packet+struct.pack(">i", 0)
packet = packet+struct.pack(">i", transaction_id)

clisocket.sendto(packet, ("tracker.istole.it", 80))
res = clisocket.recv(16)

print struct.unpack(">i", res[12:16])
The both integers printed should be same but when I run this, they aren't.

Corresponding stackoverflow which was un-answered. -> http://stackoverflow.com/questions/7758 ... -in-python

Re: Check Seeds/Peers on a UDP tracker

Posted: Fri Nov 11, 2011 10:47 pm
by Cas
We use the libtorrent rasterbar library so anything to do with the bittorrent protocol and trackers is dealt with by that.

Re: Check Seeds/Peers on a UDP tracker

Posted: Sat Nov 12, 2011 3:19 am
by shadyabhi