Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the peer list from torrent tracker response

Tags:

bittorrent

I am making a torrent client. I decode the torrent file and send this request to the tracker:

http://tracker.mininova.org/announce?uploaded=0&downloaded=0&compact=0&event=started&peer_id=12345678987654321234&port=6881&info_hash=%18%28n%23K%ECt%B7%93S%C5%F1-%F3%1C%18k%CEX%A4&left=0 

and this is what I received:

{'min interval': 1800, 'peers': '', 'interval': 1800, 'complete': 37, 'incomplete': 0}

Why is the peer list empty? There are 37 peers that are seeders, shouldn't I get some peer information from them?

like image 996
help Avatar asked Oct 22 '22 23:10

help


1 Answers

The reason that you got an empty peer list is because the tracker don't send seeds to other seeds and there was no leechers registered at the moment of the request.

The tracker registered you as a seed because you sent &left=0in the request string, indicating that you have the complete torrent.

Instead, say the torrent is 200075 bytes and the client has not downloaded anything yet,
it should add &left=200075and the announce will be:

http://tracker.mininova.org/announce?uploaded=0&downloaded=0&compact=0&event=started&peer_id=12345678987654321234&port=6881&info_hash=%18%28n%23K%ECt%B7%93S%C5%F1-%F3%1C%18k%CEX%A4&left=200075

and there will be no answer because the tracker is long dead.

See: https://wiki.theory.org/index.php/BitTorrent_Tracker_Protocol#Basic_Tracker_Announce_Request

like image 155
Encombe Avatar answered Oct 31 '22 11:10

Encombe