summaryrefslogtreecommitdiff
path: root/app/Console/Commands/ScrapeYoutube.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2020-06-20 21:07:45 +0100
committerFbenas <philbeansburton@gmail.com>2020-06-20 21:07:45 +0100
commit8d6e8b306d7836e4075a13ad98617bfe5afaa1a0 (patch)
tree99c44e28da231cac0d9e513aabc1ee0768972426 /app/Console/Commands/ScrapeYoutube.php
parent897b68ac107f2fb0d4dc1d31ce96ce24c862eb27 (diff)
Add new scripts for youtube downloading and syncing with existing matches
Diffstat (limited to 'app/Console/Commands/ScrapeYoutube.php')
-rw-r--r--app/Console/Commands/ScrapeYoutube.php13
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;
}