masih/youtubedownloader
PHP/Composer YouTube video downloader with CLI tool. Download videos (and playlists) and fetch info by URL or ID; supports setting download path and uses a writable cache directory. Requires PHP 5.5+.
guzzlehttp/guzzle, symfony/process) that may conflict with Laravel’s versions.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| YouTube API Violations | Critical | Use official YouTube Data API for production; restrict package to internal/opt-in use. |
| Dependency Conflicts | High | Isolate package in a separate Composer package or use replace in composer.json. |
| Blocking Operations | High | Offload downloads to Laravel Queues (Redis/Database) with retries. |
| Maintenance Burden | Medium | Monitor for abandonware (last commit: 2017). Fork if critical bugs arise. |
| Error Handling | Medium | Wrap calls in try-catch blocks; log failures to Sentry/Monolog. |
php artisan youtube:download --url=...).YoutubeDownloadJob extending ShouldQueue).composer.json).Process facade can coexist.storage/app/youtube) or S3 for cloud storage.composer create-project to avoid global installs.composer.json snippet:
"require": {
"masih/youtubedownloader": "^1.0",
"guzzlehttp/guzzle": "^7.2" // Pin to avoid conflicts
},
"replace": {
"guzzlehttp/guzzle": "guzzlehttp/guzzle:^7.2" // Force Laravel’s version
}
namespace App\Services;
use Masih\YoutubeDownloader\YoutubeDownloader;
class YoutubeService {
public function download(string $url, string $path): bool {
$downloader = new YoutubeDownloader();
return $downloader->download($url, $path);
}
}
namespace App\Jobs;
use App\Services\YoutubeService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
class DownloadYoutubeVideo implements ShouldQueue {
use Queueable;
public function handle(YoutubeService $service) {
$service->download($this->url, $this->path);
}
}
POST /api/download) with manual testing.youtube.download events) and alerts for failures.throttle middleware).guzzlehttp/guzzle and symfony/process versions to avoid conflicts.try-catch to handle:
RuntimeException (download failures).InvalidArgumentException (malformed URLs).README with Laravel-specific usage (e.g., queue job examples).{
"event": "youtube.download.failed",
"url": "https://youtu.be/...",
"error": "Video unavailable",
"user_id": 123
}
youtube:retry Artisan command).'connections' => [
'youtube' => [
'driver' => 'database',
'table' => 'youtube_downloads',
'queue' => 'youtube',
How can I help you explore Laravel packages today?