atphp/youtube-downloader

v0.1.1 2015-05-17 23:43 UTC

This package is auto-updated.

Last update: 2024-10-12 20:22:48 UTC


README

Download it using composer

composer require atphp/youtube-downloader

Use it

use atphp\youtube_downloader\YoutubeDownloader;
use Monolog\Handler\ErrorLogHandler;
use Monolog\Logger;

require_once __DIR__ . '/vendor/autoload.php';

$logger = new Logger('at.youtube-downloader');
$logger->pushHandler(new ErrorLogHandler());

$yd = new YoutubeDownloader();
$yd->setLogger($logger);

print_r([
    'downloadURL' => $yd->getDownloadUrl($videoId = 'U839NZ78EOo', $format = 'best')
]);