Saher Ahwal
Saher Ahwal

Reputation: 9237

Get IP addresses from udp and http torrent tracker response

I am trying to get the peer-list: list of IP addresses from a torrent tracker

Similar to the question here: how to get the peer list from torrent tracker response

I wrote code which decodes the torrent files using the python bencode Bit-torrent library I wrote code following this code here to scrape torrent tracker.

At least for http request like to mininova tracker I get the following output for a specific info_hash

{'files': {'\xbf\xff&\xcdY\x05\x9b\xb2C2j\x83\xf5F_\x9bg\x9d\xe2G': {'downloaded': 25416, 'complete': 12, 'incomplete': 0}}}

I do not see any of the other keys that the BitTorrent documents here in the spec. (like tracker_id, min_interval, peers ...etc)

How can I get the peer list?

Upvotes: 12

Views: 5068

Answers (2)

Encombe
Encombe

Reputation: 2090

To get a peer list etc. from the tracker, you need to make an announce to it.
What you ar doing is a scrape.

You can find an example of an announce here: Why does tracker server NOT understand my request? (Bittorrent protocol)

More info about scrape here: http://wiki.vuze.com/w/Scrape
Decode Torrent Hash of Torrent tracker scrape?

Upvotes: 2

fejesjoco
fejesjoco

Reputation: 11903

Not all torrents send you a peer list for scrape requests, in fact what I found is that barely any of the big ones do. You need to send them a request that you started downloading the torrent (at the announce URL), only then will you get a peer list. You can look at the binary data yourself to see if peers are there or not or you could upload a sample response for me.

Upvotes: 2

Related Questions