PHPackages                             roamingwilson/youtube-tools - 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. roamingwilson/youtube-tools

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

roamingwilson/youtube-tools
===========================

Project made for Jaafar Aziz UpWork project, to download and cut YouTube videos.

017[1 issues](https://github.com/roamingwilson/youtube-tools/issues)PHP

Since Aug 8Pushed 9mo agoCompare

[ Source](https://github.com/roamingwilson/youtube-tools)[ Packagist](https://packagist.org/packages/roamingwilson/youtube-tools)[ RSS](/packages/roamingwilson-youtube-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

YouTube Tools PHP Package
=========================

[](#youtube-tools-php-package)

[GitHub Repository](https://github.com/roamingwilson/youtube-tools)

Download and cut clips from YouTube videos using [`yt-dlp`](https://github.com/yt-dlp/yt-dlp) and [`ffmpeg`](https://ffmpeg.org/), and cut them into smaller clips.

📦 Installation
--------------

[](#-installation)

### Requirements

[](#requirements)

- PHP 7.4+
- `yt-dlp` installed
- `ffmpeg` installed

### Install on Different OS:

[](#install-on-different-os)

#### ✅ Ubuntu / Debian

[](#-ubuntu--debian)

```
sudo apt update
sudo apt install ffmpeg
pip install -U yt-dlp
```

#### ✅ macOS

[](#-macos)

```
brew install ffmpeg
pip install -U yt-dlp
```

#### Install the PHP package

[](#install-the-php-package)

```
composer require roamingwilson/youtube-tools
```

### Usage

[](#usage)

```
use RoamingWilson\YouTubeTools\YouTubeTools;

$tools = new YouTubeTools(
    '/your/temp/dir',                 // Optional temp directory
    '/your/cookies.txt'              // Optional cookies.txt file from browser
);

$result = $tools->downloadAndCut(
    'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
    [
        ['from' => '00:00:00', 'to' => '00:00:10'],
        ['from' => '00:01:00', 'to' => '00:01:30'],
    ],
    '/your/output/dir'
);

print_r($result);
```

### How to get cookies.txt

[](#how-to-get-cookiestxt)

To get the `cookies.txt` file, you can use browser extensions like [Get cookies.txt LOCALLY](https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc). Visit YouTube and export the cookies.

### 🛠 Features

[](#-features)

- Download any YouTube video with yt-dlp
- Cut multiple time-based clips using ffmpeg
- Optional crop (if `crop_x`, `crop_y`, `crop_width`, `crop_height` provided)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance41

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c16dbc18289ed17082957653061b3e134cbe161c90c9a76b72234ba1d115c3c?d=identicon)[roamingwilson](/maintainers/roamingwilson)

---

Top Contributors

[![roamingwilson](https://avatars.githubusercontent.com/u/54779488?v=4)](https://github.com/roamingwilson "roamingwilson (15 commits)")

### Embed Badge

![Health badge](/badges/roamingwilson-youtube-tools/health.svg)

```
[![Health](https://phpackages.com/badges/roamingwilson-youtube-tools/health.svg)](https://phpackages.com/packages/roamingwilson-youtube-tools)
```

###  Alternatives

[webpatser/laravel-uuid

Laravel integration for webpatser/uuid - High-performance drop-in UUID replacements (15% faster than Ramsey). Provides Str macros, HasUuids trait, facades, and casts. RFC 4122/9562 compliant.

1.8k17.3M129](/packages/webpatser-laravel-uuid)

PHPackages © 2026

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