PHP code example of rleroi / debrid

1. Go to this page and download the library: Download rleroi/debrid 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/ */

    

rleroi / debrid example snippets


use RLeroi\Debrid\Client;

function getLink(Client $client, string $magnet): ?string
{
  // 1 add magnet (  // 2. get all files
  $files = $client->getCachedFiles($magnet);

  if (!count($files)) {
    return null;
  }

  // 3. get stream/download link for a specific file
  return $client->getLink($magnet, $files[0]->path);
}

$client = (new Client())
    ->setClientPremiumize('your-token');
$magnet = 'magnet:?xt=urn:btih:34FF1FAE9661D72152FB1FC31E27C15297072654&dn=example+torrent';

getLink($client, $magnet);

// Real-Debrid -- Note: Real-Debrid ');

// AllDebrid  
$client->setClientAllDebrid('token');

// Premiumize
$client->setClientPremiumize('token');

// TorBox
$client->setClientTorBox('token');

// DebridLink (TODO)
//$client->setClientDebridLink('token');