PHPackages                             p3sdev/php-ytdlp-wrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. p3sdev/php-ytdlp-wrapper

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

p3sdev/php-ytdlp-wrapper
========================

Robust PHP 8.4 yt-dlp wrapper with Symfony 7 bundle integration

v1.0.4(4mo ago)0136MITPHPPHP ^8.4CI passing

Since Feb 14Pushed 4mo agoCompare

[ Source](https://github.com/PavlenkoEvgeniy/php-ytdlp-wrapper)[ Packagist](https://packagist.org/packages/p3sdev/php-ytdlp-wrapper)[ Docs](https://github.com/p3s/php-ytdlp-wrapper)[ RSS](/packages/p3sdev-php-ytdlp-wrapper/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

🎬 php-ytdlp-wrapper
===================

[](#-php-ytdlp-wrapper)

Robust `yt-dlp` wrapper for **PHP 8.4** with a ready-to-use **Symfony 7 bundle**.

✨ Features
----------

[](#-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
--------------

[](#-requirements)

- PHP 8.4+
- `yt-dlp` installed on the host machine (binary in `PATH` or custom path)

📦 Install
---------

[](#-install)

```
composer require p3sdev/php-ytdlp-wrapper
```

🧩 Symfony 7 Bundle Setup
------------------------

[](#-symfony-7-bundle-setup)

### 1️⃣ Register bundle

[](#1️⃣-register-bundle)

If Symfony Flex does not auto-register it, add to `config/bundles.php`:

```
return [
    // ...
    P3s\YtDlp\YtDlpBundle::class => ['all' => true],
];
```

### 2️⃣ Configure bundle

[](#2️⃣-configure-bundle)

Create `config/packages/yt_dlp.yaml`:

```
yt_dlp:
  binary_path: 'yt-dlp'
  default_arguments: ['--no-warnings']
  working_directory: ~
  timeout: 300
  environment: {}
```

🍱 Symfony Flex Recipe
---------------------

[](#-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
------------------

[](#-usage-in-symfony)

Inject `P3s\YtDlp\YtDlpClientInterface` into your service:

```
