Get IP addresses from udp and http torrent tracker

2019-06-16 05:43发布

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?

2条回答
女痞
2楼-- · 2019-06-16 06:01

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.

查看更多
Animai°情兽
3楼-- · 2019-06-16 06:01

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?

查看更多
登录 后发表回答