PHP code example of pxgamer / getiplayer-php

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

    

pxgamer / getiplayer-php example snippets


use pxgamer\GetiPlayer;

$client = new GetiPlayer\Client();

echo 'Episode URL: ' . $client->setUrl('https://www.bbc.co.uk/iplayer/episode/b088ppll/sherlock-series-4-2-the-lying-detective') . "\n";

echo 'Video ID: ' . $client->getVideoId() . "\n";
echo 'Output Quality: ' . $client->setQuality('highish') . "\n";

$client->getMediaISM();

echo 'Discovered URL: ' . $client->discoveredUrl . "\n";
echo 'Master Key: ' . $client->getMasterKey() . "\n";

$client->getM3u8();
$client->getStream();
//echo "M3u8: " . $client->getM3u8() . "\n";
//echo "M3u8 Stream: " . $client->getStream() . "\n";

echo 'Programme ID: ' . $client->getProgrammeId() . "\n";
echo 'Programme Title: ' . $client->getFullProgramTitle() . "\n";

$client->listHlsFiles();

$client->createDirectories();

echo 'Parsed: ' . $client->downloadFiles($client->hlsFiles) . "\n";

echo 'Files written: ' . $client->writeFiles() . "\n";

$client->cleanDirectory();

echo "Cleaned directory\n";

 bash
$ composer