Sending scrape request for getting torrent's seeds and peers

强颜欢笑 提交于 2019-12-03 03:32:16
Nikolai Gorchilov

I can't help you with code, due to my limited experience with PHP, but dealing with HTTP trackers should be fairly easy.

Get the announce URL, search and replace the word "announce" with "scrape" and add ?infohash=<url-encoded-binary-20-byte-long-infohash> as parameter (you may add as many infohash= to your query, divided by ampersand. Make a HTTP call to that resulting URL and read your bencoded answer. It will contain all the requested info-hashes with their respective downloads, seeders ('complete' in tracker's vocabulary) and leechers ('incomplete'). HTTP scrape is very well documented.

Dealing with UDP trackers is somewhat more complicated, because this binary form of communication happens at much lower level. Check the full description of UDP tracker protocol.

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