Sending a cleaning request to receive torrent seeds and peers

I am trying to create a torrent site, but I am stuck with the following. How to send a request to download a torrent to get its seeder and leechers?

I have a PHP class function that provides me with a list of declarations.

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;
}

This code is based on data encoded by bencode.php . How to show the Seeds and Peers of each consecutive declaring url like this?

Annouce Url | Seeds : No. | Peers: No.     
Annouce Url | Seeds : No. | Peers: No.     
Annouce Url | Seeds : No. | Peers: No. 
and so on.....
+5
source share
1 answer

I can’t help you with the code because of my limited experience with PHP, but working with HTTP trackers should be pretty simple.

URL- , "" "scrape" ?infohash=<url-encoded-binary-20-byte-long-infohash> ( infohash= , .) HTTP- URL- bencoded. - , ( "" ) leechers ( "" ). HTTP scrape .

UDP , . UDP.

+4

All Articles