https://github.com/devinnorgarb/devtube
Laravel YouTube and Online Video viewing and download interface.
https://github.com/devinnorgarb/devtube
laravel laravel-5-package laravel-package laravel5 mp3 mp3-converter mp4 php video-downloader youtube-dl youtubedownloader
Last synced: 7 months ago
JSON representation
Laravel YouTube and Online Video viewing and download interface.
- Host: GitHub
- URL: https://github.com/devinnorgarb/devtube
- Owner: DevinNorgarb
- License: mit
- Created: 2018-05-04T21:11:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-15T19:58:14.000Z (about 1 year ago)
- Last Synced: 2025-03-16T02:09:47.050Z (7 months ago)
- Topics: laravel, laravel-5-package, laravel-package, laravel5, mp3, mp3-converter, mp4, php, video-downloader, youtube-dl, youtubedownloader
- Language: PHP
- Homepage: http://devtube.devswebdev.com/#
- Size: 64.5 KB
- Stars: 36
- Watchers: 4
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Install DevTube Video Downloader
Install FFMPEG only if you want to convert videos to mp3 etc
Ubuntu:
```bash
sudo apt install ffmpeg
```Install `youtube-dl`
```bash
sudo apt install youtube-dl
```Install via composer
```bash
composer require devswebdev/devtube
```Publish vendor assets
```bash
php artisan vendor:publish --provider="DevsWebDev\DevTube\DevTubeServiceProvider"
```This publishes a `devtube.php` file in your `config/` directory
Please set your default options there.Make sure your `youtube-dl` path is correct by comparing the output of `which youtube-dl` to the `bin_path` in `devtube.php`
```php
"bin_path" => "/usr/bin/youtube-dl",
```An Example
```php
namespace App\Http\Controllers;
use DevsWebDev\DevTube\Download;class YoutubeDownloadController extends Controller
{
public function download()
{
$dl = new Download($url = "https://www.youtube.com/watch?v=ye5BuYf8q4o", $format = "mp4", $download_path = "music" );//Saves the file to specified directory
$media_info = $dl->download();
$media_info = $media_info->first();// Return as a download
return response()->download($media_info['file']->getPathname());}
}
```Or in your web.php routes file
```php
use DevsWebDev\DevTube\Download;Route::get('/', function () {
$dl = new Download($url = "https://www.youtube.com/watch?v=ye5BuYf8q4o", $format = "mp3", $download_path = "music" );//Saves the file to specified directory
$media_info = $dl->download();
$media_info = $media_info->first();// Return as a download
return response()->download($media_info['file']->getPathname());});
```