das-l/youtube-dl-bundle
最新稳定版本:1.0.0
Composer 安装命令:
composer require das-l/youtube-dl-bundle
包简介
Symfony bundle that provides service injection and config for norkunas/youtube-dl-php
README 文档
README
Symfony bundle that provides service injection and config for norkunas/youtube-dl-php, a PHP wrapper for youtube-dl or yt-dlp.
Service config provided
services: # ... das_l_youtube_dl: class: YoutubeDl\YoutubeDl arguments: - '@das_l_youtube_dl.process_builder' - '@das_l_youtube_dl.metadata_reader' - '@filesystem' calls: - setBinPath: ['%das_l_youtube_dl.binPath%'] - setPythonPath: ['%das_l_youtube_dl.pythonPath%'] das_l_youtube_dl.process_builder: class: YoutubeDl\Process\DefaultProcessBuilder das_l_youtube_dl.metadata_reader: class: YoutubeDl\Metadata\DefaultMetadataReader
Service usage
Note: For more details on the usage of the library itself, check out the documentation provided by norkunas/youtube-dl-php.
services: # ... App\Foo\YouTubeFoo: arguments: - '@das_l_youtube_dl'
<?php namespace App\Foo; use YoutubeDl\Options; use YoutubeDl\YoutubeDl; class YouTubeFoo { private $youtubeDl; public function __construct(YoutubeDl $youtubeDl) { $this->youtubeDl = $youtubeDl; } public function downloadVideo($downloadPath, $url) { $options = Options::create() ->downloadPath($downloadPath) ->url($url) ; $collection = $this->youtubeDl->download($options); // ... } }
Config options
das_l_youtube_dl: binPath: '/your/custom/bin/path/youtube-dl' pythonPath: '/your/custom/path/for/python'
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-22