soragui/ytd-library

PHP wrapper for youtube-dl

v0.2 2023-09-14 11:14 UTC

This package is auto-updated.

Last update: 2024-09-14 13:16:14 UTC


README

Fork from alltube which is nolonger maintain.

This library lets you extract a video URL from a webpage by providing a wrapper for youtube-dl.

You can install it with:

composer require soragui/ytd-library

You can then use it in your PHP code:

use Ytd\Library\Downloader;

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

$downloader = new Downloader('/usr/local/bin/youtube-dl');
$video = $downloader->getVideo('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
$video->getUrl();