mokhosh/laravel-youtube-downloader

download youtube videos in your laravel applications (for personal and educational purposes of course)

v1.0.0 2023-12-10 14:47 UTC

This package is auto-updated.

Last update: 2024-11-08 11:10:05 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

composer require mokhosh/laravel-youtube-downloader

Usage

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;

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.