Download the PHP package p3sdev/php-ytdlp-wrapper without Composer
On this page you can find all versions of the php package p3sdev/php-ytdlp-wrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-ytdlp-wrapper
๐ฌ php-ytdlp-wrapper
Robust yt-dlp wrapper for PHP 8.4 with a ready-to-use Symfony 7 bundle.
โจ Features
- Safe process execution through
symfony/process - Structured request object (
YtDlpRequest) - Raw execution + JSON extraction helpers
- Strong error model (
BinaryNotFoundException,ProcessFailedException) - Symfony 7 service wiring and configurable bundle options
๐ Requirements
- PHP 8.4+
yt-dlpinstalled on the host machine (binary inPATHor custom path)
๐ฆ Install
๐งฉ Symfony 7 Bundle Setup
1๏ธโฃ Register bundle
If Symfony Flex does not auto-register it, add to config/bundles.php:
2๏ธโฃ Configure bundle
Create config/packages/yt_dlp.yaml:
๐ฑ Symfony Flex Recipe
A ready-to-submit Symfony Flex recipe scaffold is available in:
flex-recipe/1.0
To publish it for auto-install support, submit that recipe to symfony/recipes-contrib.
๐ Usage in Symfony
Inject P3s\YtDlp\YtDlpClientInterface into your service:
๐ ๏ธ Core API
โฌ๏ธ download(string|array $urls, array $options = []): ProcessResult
Runs yt-dlp for download/processing workflows.
๐ง rawJson(string|array $urls, array $options = []): ProcessResult
Runs metadata mode (--dump-json --skip-download --no-warnings) and returns full process output.
๐ extractInfo(string|array $urls, array $options = []): array
Convenience method that returns parsed JSON lines.
โ๏ธ run(YtDlpRequest $request): ProcessResult
Low-level execution with full control over options, flags, and extra arguments.
๐งพ YtDlpRequest
โ ๏ธ Errors
BinaryNotFoundException: custom binary path does not exist or is not executableProcessFailedException: command returned non-zero exit codeYtDlpException: base runtime exception
๐ Notes
- The wrapper maps options directly to
yt-dlpCLI flags (format->--format). - Arrays in option values are emitted as repeated flags.
- Boolean
trueemits a flag,falseis ignored.
๐ License
MIT. See LICENSE.
โ CI
GitHub Actions runs tests on push and pull requests for PHP 8.4 and 8.5.
Workflow file: .github/workflows/tests.yml
All versions of php-ytdlp-wrapper with dependencies
symfony/process Version ^7.4.5
symfony/config Version ^7.4.4
symfony/dependency-injection Version ^7.4.5
symfony/http-kernel Version ^7.4.5