PHP code example of webtor / platform-sdk-php

1. Go to this page and download the library: Download webtor/platform-sdk-php 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/ */

    

webtor / platform-sdk-php example snippets



rentUrl = 'https://github.com/webtorrent/webtorrent.io/blob/master/static/torrents/sintel.torrent?raw=true';
$data = file_get_contents($torrentUrl);

$sdk = new Webtor\SDK([
    'apiUrl'           => 'https://api.webtor.io',
    // 'grpcAddr'         => '127.0.0.1:50051',
    'grpcAddr'         => 'grpc.webtor.io:443',
    'apiKey'           => 'your_api_key',
    'secret'           => 'your_secret',
    'grpcCredentials'  => \Grpc\ChannelCredentials::createSsl(),
]);

$infoHash = $sdk->torrent()->push($data);
$url = $sdk->seeder($infoHash)->url('/Sintel/Sintel.mp4');
echo($url);

composer