athlon1600/youtube-downloader
A pure PHP YouTube downloader with no JavaScript interpreters, shell calls, or heavy dependencies. Fetch video and audio stream links via a simple API, with built-in exception handling. Actively maintained.
Architecture fit
youtube-dl/yt-dlp binary to ship, patch, and defend in a container. For a Laravel estate under security review, eliminating exec() and a vendored Python binary removes an entire category of findings and CVE-tracking obligations.YouTubeDownloader::getDownloadLinks() returns a DownloadOptions aggregate of StreamFormat objects plus a VideoInfo object, with helpers (getCombinedFormats(), getFirstCombinedFormat()) and typed exceptions. That is easy to wrap in a Laravel service class and mock behind an interface.Browser via php-curl-file-downloader) rather than using Guzzle or Illuminate\Http\Client. It therefore bypasses Laravel's HTTP middleware, retry helpers, Http::fake(), and structured logging. Outbound traffic policy and observability must be built around it, not inside it.Integration feasibility
composer require athlon1600/youtube-downloader ^4.0. The PHP ^7.4 || ^8.0 floor is moot on a current stack (Laravel 10+ already requires 8.1+), and the dependency graph is genuinely thin, so conflict risk is low.429 Too Many Requests mitigation, no separate audio+video muxing via ffmpeg, and known ~100 kb/s throttling for many videos. Several of these are not nice-to-haves — the missing DASH merge caps practical output quality, and captcha/429 handling determines whether the thing works at any volume.YouTubeStreamer proxies an arbitrary googlevideo.com URL passed by the caller. Release v3.1.1 already patched a security issue around passing URLs to the demo stream.php. Exposed to users without host allowlisting and signature validation, this is an SSRF and open-relay risk. Treat as a server-side, trusted-input-only component.Technical risk
cipher → signatureCipher renames, signature-decoder regex updates, player_response parsing failures, get_video_info 404 regressions. Reliability is a function of one maintainer's reaction time, not of our engineering.Key questions
yt-dlp sidecar or hosted API) behind the same interface?Browser supports proxying since v2.0.8) to survive throttling and 429s?Stack fit
YouTubeDownloaderInterface in a service provider, resolve a configured singleton, translate YouTubeException into domain exceptions, and expose the feature behind a queued job rather than a synchronous controller action. The library's synchronous cURL calls must not run in a user-facing request cycle.VideoInfo metadata and StreamFormat rows (itag, mime type, quality, expiry) so the UI can render format choices without re-scraping.Migration path
yt-dlp/youtube-dl binary exists today, do not rip it out. Define the interface first, implement AthlonDownloaderAdapter and keep the existing binary implementation as YtDlpAdapter. Route traffic by config flag and canary percentage. This gives a one-line rollback and turns the buy-vs-build question into a runtime decision.Compatibility
curl extensions and outbound TLS in the runtime image; the bundled client uses cURL directly, so any HTTP proxy or egress policy must be configured through Browser, not through Laravel's HTTP client config.Sequencing
Maintenance
Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?