PHP code example of devitek / torrent-fake-seeder

1. Go to this page and download the library: Download devitek/torrent-fake-seeder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

devitek / torrent-fake-seeder example snippets




evitek\Net\Torrent\Client\Azureus\Azureus45;
use Devitek\Net\Torrent\Seeder;
use Devitek\Net\Torrent\Torrent;

$torrent = new Torrent('file.torrent');
$client  = new Azureus45();
$seeder  = new Seeder($client, $torrent);

$seeder->bind('update', function ($data) {
    echo $data['uploaded'] . ' MB at ' . $data['speed'] . ' MB/sec uploaded' . PHP_EOL;
});

$seeder->bind('error', function ($data) {
    echo $data['exception']->getMessage() . PHP_EOL;
});

$seeder->seed();