PHPackages                             devswebdev/devtube - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. devswebdev/devtube

ActiveLibrary[File &amp; Storage](/categories/file-storage)

devswebdev/devtube
==================

A Laravel package for downloading videos from the net by simply passing a URL

v3.0.0(1mo ago)367959[6 issues](https://github.com/DevinNorgarb/devtube/issues)[1 PRs](https://github.com/DevinNorgarb/devtube/pulls)MITPHPPHP ^8.3CI passing

Since May 5Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/DevinNorgarb/devtube)[ Packagist](https://packagist.org/packages/devswebdev/devtube)[ RSS](/packages/devswebdev-devtube/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (13)Versions (20)Used By (0)

DevTube
=======

[](#devtube)

[![Tests](https://github.com/DevinNorgarb/devtube/actions/workflows/tests.yml/badge.svg)](https://github.com/DevinNorgarb/devtube/actions/workflows/tests.yml)[![License: MIT](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

A Laravel package for downloading videos (and extracting audio) from the web by passing a URL. DevTube is a thin, modern wrapper around the [`yt-dlp`](https://github.com/yt-dlp/yt-dlp) binary via [`norkunas/youtube-dl-php`](https://github.com/norkunas/youtube-dl-php).

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

[](#requirements)

- PHP **8.3+**
- Laravel **12** or **13**
- The [`yt-dlp`](https://github.com/yt-dlp/yt-dlp) binary available on your server
- [`ffmpeg`](https://ffmpeg.org/) (only required for audio extraction, e.g. converting to `mp3`)

### Installing the binaries

[](#installing-the-binaries)

```
# yt-dlp (recommended install method: pip)
python3 -m pip install -U yt-dlp

# ffmpeg (Ubuntu/Debian) — only needed for mp3/audio extraction
sudo apt install ffmpeg
```

Confirm the binary location so it matches your config:

```
which yt-dlp
```

Installation
------------

[](#installation)

```
composer require devswebdev/devtube
```

The package registers itself automatically (service provider + `DevTube` facade alias) via Laravel package discovery.

Publish the config file:

```
php artisan vendor:publish --provider="DevsWebDev\DevTube\DevTubeServiceProvider" --tag=config
```

This publishes `config/devtube.php`.

Configuration
-------------

[](#configuration)

```
return [
    // Path to the yt-dlp binary. Use an absolute path if it is not on the PATH.
    'bin_path' => env('DEVTUBE_YT_DLP_PATH', 'yt-dlp'),

    // Directory (relative to storage_path()) where downloads are saved by default.
    'download_path' => env('DEVTUBE_DOWNLOAD_PATH', 'app/devtube'),

    // Format key (see 'formats') used when none is supplied.
    'default_format' => 'mp4',

    // yt-dlp output filename template.
    'output_template' => '%(title)s.%(ext)s',

    // Per-format yt-dlp options.
    'formats' => [
        'mp4' => [
            'format' => 'mp4',
        ],
        'mp3' => [
            'extract_audio' => true,
            'audio_format' => 'mp3',
            'audio_quality' => '0',
        ],
    ],
];
```

Set the binary path via `.env` if needed:

```
DEVTUBE_YT_DLP_PATH=/usr/local/bin/yt-dlp
DEVTUBE_DOWNLOAD_PATH=app/devtube
```

Usage
-----

[](#usage)

`download()` returns an `Illuminate\Support\Collection` of `DevsWebDev\DevTube\MediaFile` objects. Each `MediaFile` exposes:

MemberTypeDescription`$media->title``?string`The resolved title (null on failure)`$media->file``?SplFileInfo`The downloaded file (null on failure)`$media->error``?string`Error message for this item, or null`$media->path()``?string`Absolute path to the file, or null`$media->wasSuccessful()``bool`Whether this item downloaded successfully### Using the facade

[](#using-the-facade)

```
use DevsWebDev\DevTube\Facades\DevTube;

$results = DevTube::download('https://www.youtube.com/watch?v=ye5BuYf8q4o', 'mp4');

$media = $results->first();

if ($media->wasSuccessful()) {
    return response()->download($media->path());
}

report($media->error);
```

### Using the `Download` class

[](#using-the-download-class)

```
use DevsWebDev\DevTube\Download;

$results = (new Download(
    url: 'https://www.youtube.com/watch?v=ye5BuYf8q4o',
    format: 'mp3',
))->download();

$media = $results->first();

return response()->download($media->path());
```

The third argument is an absolute download directory override. When omitted, files are saved under `storage_path(config('devtube.download_path'))`, creating the directory if needed:

```
DevTube::download($url, 'mp4', '/var/www/storage/app/my-downloads');
```

### Using the Artisan command

[](#using-the-artisan-command)

```
php artisan devtube:download "https://www.youtube.com/watch?v=ye5BuYf8q4o" --format=mp3
php artisan devtube:download "https://www.youtube.com/watch?v=ye5BuYf8q4o" --format=mp4 --path=/absolute/download/dir
```

The command prints a table of results and exits non-zero if any item failed.

Error handling
--------------

[](#error-handling)

- **Per-video problems** (e.g. an unavailable video in a playlist) surface as a `MediaFile` with a non-null `error` and `wasSuccessful() === false`. Always check `wasSuccessful()` before using `path()`.
- **Hard failures** (missing binary, unwritable directory, or a failed `yt-dlp` process) throw `DevsWebDev\DevTube\Exceptions\DownloadException`.

Upgrading from 2.x to 3.0
-------------------------

[](#upgrading-from-2x-to-30)

3.0 is a breaking release that replaces the old, unmaintained download engines with a single `yt-dlp`-based engine.

**Requirements**

- PHP 8.3+ and Laravel 12/13 are now required.
- Install the `yt-dlp` binary (replacing `youtube-dl`). Point `bin_path` at it. If you still use `youtube-dl`, set `bin_path` to that binary — but `yt-dlp` is recommended.

**Removed**

- The `masih/youtubedownloader` and `athlon1600/youtube-downloader` dependencies, the custom cURL scraper, and the internal classes `MediaDownload`, `DownloadConfig`, and `HelperTrait`.

**Results are objects, not arrays**

- `download()` now returns a `Collection` of `MediaFile` objects. Replace array access with object access:

```
// 2.x
$media_info = $dl->download()->first();
return response()->download($media_info['file']->getPathname());

// 3.0
$media = $dl->download()->first();
return response()->download($media->path());
```

**Config file changed**

- `config/devtube.php` was rewritten with new keys (`bin_path`, `download_path`, `default_format`, `output_template`, `formats`). Old keys were removed. Re-publish the config and re-apply your settings:

```
php artisan vendor:publish --provider="DevsWebDev\DevTube\DevTubeServiceProvider" --tag=config --force
```

**New entry points**

- A `DevTube` facade and a `devtube:download` Artisan command were added. The `Download` class and its `->download()` method are still available.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE) for more information.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance88

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~372 days

Recently: every ~635 days

Total

9

Last Release

43d ago

Major Versions

1.0.5 → 2.0.12019-07-20

2.0.6 → v3.0.02026-07-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12491966?v=4)[Devin Norgarb](/maintainers/DevinNorgarb)[@DevinNorgarb](https://github.com/DevinNorgarb)

---

Top Contributors

[![DevinNorgarb](https://avatars.githubusercontent.com/u/12491966?v=4)](https://github.com/DevinNorgarb "DevinNorgarb (146 commits)")

---

Tags

laravellaravel-5-packagelaravel-packagelaravel5mp3mp3-convertermp4phpvideo-downloaderyoutube-dlyoutubedownloaderlaravellaravel-packagedownloaderyt-dlpmp3youtube-dlmp4youtube downloaderlaravel-youtube-downloadervideo downloaderdevtubedevswebdevmp3 downloadermedia downloaderlaravel downloader

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devswebdev-devtube/health.svg)

```
[![Health](https://phpackages.com/badges/devswebdev-devtube/health.svg)](https://phpackages.com/packages/devswebdev-devtube)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k212.4M1.4k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M307](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M220](/packages/laravel-mcp)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.8k](/packages/tomshaw-electricgrid)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)

PHPackages © 2026

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