Youtube extension for jackal/video-downloader
composer require jackal/video-downloader-ext-youtube
use Jackal\Downloader\Ext\Youtube\Downloader\YoutubeDownloader;
require_once __DIR__ . '/vendor/autoload.php';
$youtubeVideoId = 'otCpCn0l4Wo';
$vd = new \Jackal\Downloader\VideoDownloader();
$vd->registerDownloader(YoutubeDownloader::VIDEO_TYPE, YoutubeDownloader::class);
$downloader = $vd->getDownloader(YoutubeDownloader::VIDEO_TYPE, $youtubeVideoId, [
'format' => [360,480]
]);
$downloader->download(__DIR__ . '/output.avi');