diff options
Diffstat (limited to 'app/Console/Commands/ScrapeYoutube.php')
-rw-r--r-- | app/Console/Commands/ScrapeYoutube.php | 13 |
1 files changed, 10 insertions, 3 deletions
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; } |