download youtube videos in your laravel applications (for personal and educational purposes of course)
You can install the package via composer:
composer require mokhosh/laravel-youtube-downloader
use Mokhosh\Facades\LaravelYoutubeDownloader;
$videoId = LaravelYoutubeDownloader::getVideoIdFromUrl($youtubeUrl);
$video = LaravelYoutubeDownloader::getYoutubeVideoMeta($videoId);
$formats = $video->streamingData->formats;
$adaptiveFormats = $video->streamingData->adaptiveFormats;
$title = $video->videoDetails->title;
$short_description = $video->videoDetails->shortDescription;
$thumbnails = $video->videoDetails->thumbnail->thumbnails;
$thumbnail = end($thumbnails)->url;
$channel_id = $video->videoDetails->channelId;
$channel_name = $video->videoDetails->author;
$views = $video->videoDetails->viewCount;
$video_duration_in_seconds = $video->videoDetails->lengthSeconds;
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.