Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know the number of seeds/peers for a torrent in PHP

Tags:

php

bittorrent

When you place a .torrent file for download in your website, how can you get the number of Seeds & Peers for that Torrent and inform the user of them?

like image 817
kasrsf Avatar asked May 19 '10 13:05

kasrsf


People also ask

How do you read peer seeds?

"1 (2) seeds" means that you are connected to 1 out of 2 available seeds. Thus, "1 (4) peers" means you are connected to 1 out of 4 available peers. There really isn't any "optimal" ratio of seeds/peers.

How do I increase the number of seeds and peers in utorrent?

Disable files that you don't need to download. You'll often find that less-popular files (e.g., tutorials or uninstallers) included in torrents have far fewer individual seeds. Low numbers of seeds can cause a file to get stuck while downloading, so unchecking these files will speed up your download.

Is it better to have more seeds or peers?

The more seeds, the better the download rate. However, it is good to have more peers in addition to the seeders, as the downloaders can utilize both. Once a file is fully seeded, the BitTorrent application automatically stops the seeding process and the file can then be removed from the seeding list.

What should be seeds peers ratio?

If you seed (upload) a full copy of your downloaded content, you have a 1:1 sharing ratio. Private trackers require members to maintain at least a 1:1 sharing ratio to ensure members contribute to their communities. This means members must seed (upload) the same amount they leech (download) and, in some cases, more.


1 Answers

You have to contact the tracker(s) that is shown in the torrentfile. If the tracker support "scraping" that is probably the request you want. Otherwise its up to the tracker to decide how many peers it wants to return to you, and you have no idea if those peers is a seed or leech before contacting them.

The torrentfile is in bencoded format, look for the bdecode php library to easily parse the info.

Provide the infohash you get from the pieces information in the metadata and the tracker will respond if you follow the protocol, read http://en.wikipedia.org/wiki/BitTorrent_%28protocol%29 for more information

like image 81
baloo Avatar answered Oct 18 '22 00:10

baloo