Hi all!
I'm sorry if my question sounds stupid. I'm new to programming.
From the description I did not understand how to use this library.
My task is to download videos to my hosting. Tell me, did I understand correctly that:
1) This code will be enough to download the video?
use YouTube\YouTubeDownloader;
use YouTube\Exception\YouTubeException;
$youtube = new YouTubeDownloader();
try {
$downloadOptions = $youtube->getDownloadLinks("https://www.youtube.com/watch?v=aqz-KE-bpKQ");
if ($downloadOptions->getAllFormats()) {
echo $downloadOptions->getFirstCombinedFormat()->url;
} else {
echo 'No links found';
}
} catch (YouTubeException $e) {
echo 'Something went wrong: ' . $e->getMessage();
}
Hi all! I'm sorry if my question sounds stupid. I'm new to programming. From the description I did not understand how to use this library. My task is to download videos to my hosting. Tell me, did I understand correctly that:
1) This code will be enough to download the video?
2) Is this code written in a PHP script?
3) Where is the video saved in this case?