Skip to content

DevTube 3.0: modernize for Laravel 12/13 (PHP 8.3+) on a single yt-dlp engine#15

Merged
DevinNorgarb merged 14 commits into
masterfrom
feature/laravel-12-13-modernization
Jul 3, 2026
Merged

DevTube 3.0: modernize for Laravel 12/13 (PHP 8.3+) on a single yt-dlp engine#15
DevinNorgarb merged 14 commits into
masterfrom
feature/laravel-12-13-modernization

Conversation

@DevinNorgarb

Copy link
Copy Markdown
Owner

Summary

Revives the package on a modern stack and consolidates three dead download engines into one working yt-dlp-based engine. This is a breaking 3.0 release.

  • Stack: PHP ^8.3, Laravel 12 & 13, PHPUnit 12, Mockery, Orchestra Testbench.
  • Engine: single yt-dlp binary via norkunas/youtube-dl-php v2. Removed masih/youtubedownloader, athlon1600/youtube-downloader, the custom cURL scraper, and the dead MediaDownload / DownloadConfig / HelperTrait classes. Dropped the hardcoded version field.
  • Architecture (wired by DevTubeServiceProvider as one shared singleton 'devtube', aliased to Downloader::class):
    • Downloader service, MediaFile result DTO (keeps vendor types out of the public API), DownloadException
    • DevTube facade, devtube:download Artisan command, thin Download shim
    • Fixes the previous phantom 'devtube' -> DevTube (non-existent class) binding that fatally errored on resolution.
  • Config: rewritten config/devtube.php (bin_path, download_path, default_format, output_template, formats).
  • CI: GitHub Actions matrix (PHP 8.3/8.4/8.5 × Laravel 12/13; 8.5 on L13 only) + aligned GitLab CI.
  • Docs: README rewritten with usage (facade / Download / Artisan) and a 2.x -> 3.0 migration guide.

Notable fix

norkunas/youtube-dl-php v2 declares Video::getFile(): SplFileInfo (non-nullable) but returns null for errored videos — calling it unconditionally throws a TypeError. The mapping now only reads getFile() when getError() === null.

Breaking changes (for consumers)

  • Requires PHP 8.3+ and Laravel 12/13; requires the yt-dlp binary (plus ffmpeg for mp3/audio).
  • download() returns a Collection of MediaFile objects, not arrays: use $media->path() instead of $media['file']->getPathname().
  • config/devtube.php schema changed — re-publish with --tag=config --force.

Test plan

  • composer test green locally: 15 tests / 34 assertions (Unit + Feature) on PHP 8.3.
  • composer validate --strict passes.
  • Feature tests assert provider wiring, singleton/alias identity (assertSame), facade resolution, command registration, and devtube:download exit-code contract.
  • CI matrix green across PHP 8.3/8.4/8.5 × Laravel 12/13 (verify on this PR).
  • Manual smoke test: php artisan devtube:download "<url>" --format=mp3 against a real yt-dlp install.
  • Tag v3.0.0 after merge (breaking release; Packagist is git-tag driven).

@DevinNorgarb DevinNorgarb self-assigned this Jul 3, 2026

@DevinNorgarb DevinNorgarb left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@DevinNorgarb DevinNorgarb merged commit 305a87f into master Jul 3, 2026
6 checks passed
@DevinNorgarb DevinNorgarb mentioned this pull request Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant