how to get the peer list from torrent tracker response

ぃ、小莉子 提交于 2019-12-10 17:02:59

问题


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?


回答1:


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




回答2:


It's possible the trackers you're querying just aren't storing peers for that torrent. I was able to find peers using DHT.

The URL would be magnet:?xt=urn:btih:18286e234bec74b79353c5f12df31c186bce58a4 .



来源:https://stackoverflow.com/questions/13750775/how-to-get-the-peer-list-from-torrent-tracker-response

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!