PHPackages                             aladdindev/php-youtube-dl - 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. aladdindev/php-youtube-dl

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aladdindev/php-youtube-dl
=========================

A PHP script to help download your videos from Youtube

944011[2 issues](https://github.com/aladdindev/php-youtube-dl/issues)PHP

Since Feb 8Pushed 8y ago4 watchersCompare

[ Source](https://github.com/aladdindev/php-youtube-dl)[ Packagist](https://packagist.org/packages/aladdindev/php-youtube-dl)[ RSS](/packages/aladdindev-php-youtube-dl/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-youtube-dl
==============

[](#php-youtube-dl)

A PHP script to help you download your videos from Youtube

[![](https://camo.githubusercontent.com/5e11d2a1f11b02ace3dc69fd1d22bbb493f96ad0cf51b6b4adf67fe658d858b7/687474703a2f2f7777772e616c61646469616e2e636f6d2f696d672f7974646c2e706e67)](https://camo.githubusercontent.com/5e11d2a1f11b02ace3dc69fd1d22bbb493f96ad0cf51b6b4adf67fe658d858b7/687474703a2f2f7777772e616c61646469616e2e636f6d2f696d672f7974646c2e706e67)

Requirements
------------

[](#requirements)

- PHP &gt;=5.3
- PHP CURL extension is optional

PHPYoutubeDL
------------

[](#phpyoutubedl)

### Example #1: Basic download

[](#example-1-basic-download)

```
require_once 'vendor/autoload.php';

use PHPYoutubeDl\PHPYoutubeDl;

$php_youtube_dl = new PHPYoutubeDl("http://www.youtube.com/watch?v=xxxxxx");

$php_youtube_dl->startDownload();
```

### Example #2: Prints direct download link

[](#example-2-prints-direct-download-link)

```
require_once 'vendor/autoload.php';

use PHPYoutubeDl\PHPYoutubeDl;

$php_youtube_dl = new PHPYoutubeDl("http://www.youtube.com/watch?v=xxxxxx");

echo $php_youtube_dl->getDirectLink();
```

### Example #3: With progress function

[](#example-3-with-progress-function)

```
require_once 'vendor/autoload.php';

use PHPYoutubeDl\PHPYoutubeDl;

function showProgress($downloaded_size, $download_size){
	echo $downloaded_size / $download_size;
	echo PHP_EOL;
	flush();
}

$php_youtube_dl = new PHPYoutubeDl("http://www.youtube.com/watch?v=xxxxxx");
$php_youtube_dl->setProgressCallback('showProgress');
$php_youtube_dl->startDownload();
```

php-youtube-dl-cli
------------------

[](#php-youtube-dl-cli)

Download the [PHP script](https://raw.githubusercontent.com/aladdindev/php-youtube-dl/master/src/php-youtube-dl-cli.php).

Make sure PHP-CLI is installed and added to your PATH variable.

```
php php-youtube-dl-cli.php -f 28 -t myvideo http://youtube.com/watch?v=xxxxxx

```

### Arguments

[](#arguments)

You can use the following arguments:

OptionDescription-cPrints currently used JS cipher function.-t titleSpecify a custom filename. The video ID and the extension will still be appended to this argument.-f formatSpecify a format to download. You can access the list of available format IDs using the -l argument.-lLists the available formats for the provided video.-hPrints the help section.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8408127?v=4)[aladdindev](/maintainers/aladdindev)[@aladdindev](https://github.com/aladdindev)

---

Top Contributors

[![aladdindev](https://avatars.githubusercontent.com/u/8408127?v=4)](https://github.com/aladdindev "aladdindev (9 commits)")[![Rudloff](https://avatars.githubusercontent.com/u/840125?v=4)](https://github.com/Rudloff "Rudloff (1 commits)")

### Embed Badge

![Health badge](/badges/aladdindev-php-youtube-dl/health.svg)

```
[![Health](https://phpackages.com/badges/aladdindev-php-youtube-dl/health.svg)](https://phpackages.com/packages/aladdindev-php-youtube-dl)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
