Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Youtubedownloader

Youtubedownloader Laravel Package

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+.

View on GitHub
Deep Wiki
Context7

Youtube video downloader

Frequently asked questions about Youtubedownloader
Can I use this package directly in a Laravel controller without blocking the request?
No, this package performs synchronous downloads, which will block Laravel’s request lifecycle. For production, offload downloads to Laravel Queues (e.g., `ShouldQueue` jobs) or use Artisan commands for CLI-triggered processing.
How do I install this in Laravel and avoid dependency conflicts with Guzzle?
Add `masih/youtubedownloader` to `composer.json` and pin Guzzle versions explicitly. Example: `"guzzlehttp/guzzle": "^7.2"` in `require`, then use `"replace": { "guzzlehttp/guzzle": "guzzlehttp/guzzle:^7.2" }` to force compatibility.
Does this package support Laravel’s service container or Facades?
No, it lacks native Laravel integration. You’ll need to wrap the downloader in a service class or Artisan command to use Laravel’s DI container. Example: Bind the downloader to a custom Facade or inject it via constructor.
What’s the best way to store downloaded videos in Laravel?
Use Laravel’s Filesystem (e.g., `storage/app/youtube`) or S3 for cloud storage. Configure the downloader’s path via `$youtube->setPath(storage_path('app/youtube'))` and ensure the directory is writable (e.g., `chmod 777`).
Is this package compliant with YouTube’s Terms of Service?
No, automated downloads violate YouTube’s Automated Systems Policy unless you have explicit permission. For production, use the official [YouTube Data API](https://developers.google.com/youtube/v3) or restrict usage to internal, opt-in workflows.
How do I handle failed downloads or rate limits in production?
Wrap calls in `try-catch` blocks and log failures to Sentry/Monolog. For rate limits, implement retries with exponential backoff in your queued job or use proxies if YouTube blocks your IP. Monitor for HTTP 403/429 errors.
Can I download playlists or just individual videos?
Yes, the package supports both. Pass a playlist URL (e.g., `https://youtube.com/playlist?list=PL...`) or ID to download all videos in the playlist. Example: `$youtube->download('playlist_url_here')`.
What Laravel versions does this package support?
The package itself requires PHP 5.5+, but Laravel compatibility depends on your PHP version. For Laravel 8/9, use PHP 8.0+ to avoid deprecated features. Test thoroughly in a sandbox project due to potential Guzzle/Symfony conflicts.
How do I trigger downloads via a web form or API endpoint?
Create a Laravel controller/service to instantiate the downloader, then dispatch a queued job (e.g., `YoutubeDownloadJob`) with the video URL. Example: `YoutubeDownloadJob::dispatch($request->url)->onQueue('youtube');`
Are there alternatives for Laravel that avoid YouTube’s automation restrictions?
Yes, consider the [YouTube Data API](https://developers.google.com/youtube/v3) for compliant video metadata or streaming. For downloads, explore self-hosted solutions like [youtube-dl](https://ytdl-org.github.io/youtube-dl/) (via Symfony Process) or paid APIs like Mux or Cloudflare Stream.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
testo/facade
headercat/phpstan-extension-ide-helper
yosymfony/parser-utils
innmind/black-box
babenkoivan/elastic-migrations
babenkoivan/elastic-adapter
sandermuller/package-boost-php
sandermuller/boost-core
depa/sulu-google-reviews-bundle
croct/plug-symfony
develia/commons
dmstr/symfony-system-resources-bundle
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
renatomarinho/laravel-page-speed
develia/geo-bundle
austinheap/laravel-database-encryption
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle