-
Installed via composer. <?php
declare(strict_types=1);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require __DIR__ . '/vendor/autoload.php';
use YoutubeDl\Options;
use YoutubeDl\YoutubeDl;
$yt = new YoutubeDl();
$yt->setBinPath('C:\xampp\htdocs\youtube dl\yt-dlp');
$collection = $yt->download(
Options::create()
->downloadPath(__DIR__.'\down')
->url('https://www.youtube.com/watch?v=oDAw7vW7H0c')
);
foreach ($collection->getVideos() as $video) {
if ($video->getError() !== null) {
echo "Error downloading video: {$video->getError()}.";
} else {
echo "test";
echo $video->getTitle(); // Will return Phonebloks
// $video->getFile(); // \SplFileInfo instance of downloaded file
}
} additionally only set |
Beta Was this translation helpful? Give feedback.
Answered by
0lfu
Jul 27, 2023
Replies: 1 comment 1 reply
-
Set debugging to see what's going on:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, I'm on windows and solution was to download Microsoft Visual C++ 2010 Redist. After that things startet to work!