pxgamer/getiplayer-php

An easy to use wrapper for the iPlayer download API written in PHP.

v1.1.2 2017-12-06 09:57 UTC

This package is auto-updated.

Last update: 2024-11-11 14:52:01 UTC


README

Latest Version on Packagist Software License Build Status Style CI Code Coverage Total Downloads

An easy to use wrapper for the iPlayer download API written in PHP.

Structure

resources/
src/
tests/
vendor/

Install

Via Composer

$ composer require pxgamer/getiplayer-php

Usage

This currently creates a single .ts file which can be encoded using Handbrake or another encoder.

Usage

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

Note: This is based off of Tiiveni's original code from SquarePenguin.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email owzie123@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.