我一直在尝试创建一个 torrent 网站,但我遇到了以下问题。如何发送 torrent scrape 请求以获取其播种机和 leechers?
我有一个 PHP 类函数,它为我提供了公告列表。
public function getTrackers() {
// Load tracker list
$trackerlist = array();
if ( $this->torrent->get_value('announce-list') )
{
$trackers = $this->torrent->get_value('announce-list')->get_plain();
while ( list( $key, $value ) = each( $trackers ) )
{
if ( is_array( $value->get_plain() ) ) {
while ( list( $key, $value2 ) = each( $value ) )
{
while ( list( $key, $value3 ) = each( $value2 ) )
{
array_push( $trackerlist, $value3->get_plain() );
}
}
} else {
array_push( $trackerlist, $value->get_plain() );
}
}
}
else if ( $this->torrent->get_value('announce') )
{
array_push( $trackerlist, $this->torrent->get_value('announce')->get_plain() );
}
return $trackerlist;
}
此代码基于bencode.php编码的数据。如何像这样显示每个连续公告网址的种子和同行?
Annouce Url | Seeds : No. | Peers: No.
Annouce Url | Seeds : No. | Peers: No.
Annouce Url | Seeds : No. | Peers: No.
and so on.....