mail2bapi/youtube-downloader
Composer 安装命令:
composer require mail2bapi/youtube-downloader
包简介
PHP library for downloading YouTube videos
README 文档
README
A PHP library for downloading videos from YouTube without API key.
Requirements
- PHP 7.2 or higher
Installation
Run in console below command to download package to your project:
composer mail2bapi/youtube-downloader
Usage
use Mail2bapi\YouTubeDownloader\YoutubeDownloader; // Yourtube URL $yourtubeVideoUrl = '<youtube.com video URL>'; // New YoutubeDownloader instance $yt = new YoutubeDownloader(); // Enabling logging $yt->setLogging(true); // Setting location for saving videos and thumbnails. By default is saves in directory 'videos/' $yt->setDownloadFolder('<my/location>'); // Collect Video ID from URL $videoId = $yt->getVideoId($yourtubeVideoUrl); // Get Video details of a Yourtube video $videos = $yt->getVideoDetail($yourtubeVideoUrl); // $videos array have following keys // 'video_id', 'channel_id', 'duration', 'title', 'description', 'keywords', 'average_rating', 'allow_ratings', 'view_count', 'author', 'video', 'embed_video', 'adaptive_formats', 'formats', 'thumbnails' // Get array of all video qualities $videoQualities = $yt->getVideoQualities(); // Download all Thumbnail images $yt->downloadThumbnails($videos); // Download all videos as per video qualities available for the video $yt->downloadVideo(); // Download single videos as per video qualities available for the video $yt->downloadAVideo($videos['formats']['360p']['link'], $videos['video_id'], $videoQualities[0]);
Enjoyed using the library. Please help to improve it by report issues and suggesting improvements. Thank you!
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-08