Check Seeds/Peers on a UDP tracker

Suggestions and discussion of future versions
Post Reply
shadyabhi

Check Seeds/Peers on a UDP tracker

Post 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
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Check Seeds/Peers on a UDP tracker

Post by Cas »

We use the libtorrent rasterbar library so anything to do with the bittorrent protocol and trackers is dealt with by that.
shadyabhi

Re: Check Seeds/Peers on a UDP tracker

Post by shadyabhi »

Post Reply