From 8d6e8b306d7836e4075a13ad98617bfe5afaa1a0 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Sat, 20 Jun 2020 21:07:45 +0100 Subject: Add new scripts for youtube downloading and syncing with existing matches --- app/Console/Commands/ScrapeYoutube.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'app/Console/Commands/ScrapeYoutube.php') diff --git a/app/Console/Commands/ScrapeYoutube.php b/app/Console/Commands/ScrapeYoutube.php index ce64d3f..de620d4 100644 --- a/app/Console/Commands/ScrapeYoutube.php +++ b/app/Console/Commands/ScrapeYoutube.php @@ -2,6 +2,7 @@ namespace App\Console\Commands; +use App\Rugby\Model\Video; use App\Youtube\Service; use Illuminate\Console\Command; @@ -44,12 +45,18 @@ class ScrapeYoutube extends Command $service = new Service($url, $this->output); if ($format == 'video') { - $video = $service->downloadVideo('video'); + $service->downloadVideo('video'); } elseif ($format == 'audio') { - $video = $service->downloadAudio('audio'); + $service->downloadAudio('audio'); } - $this->info('Download of ' . $video->getTitle() . ' complete!'); + $video_model = Video::create( + [ + 'path' => $service->getFullPath() + ] + ); + + $this->info('Download of ' . $service->getTitle() . ' complete!'); return Command::SUCCESS; } -- cgit v1.2.3