<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Repositories\BilibiliVideoRepository;
|
|
use App\Services\BilibiliService;
|
|
use App\Services\BilibiliServiceV2;
|
|
use App\Services\FfmpegService;
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\App;
|
|
|
|
class BiliVideoCode extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'bili:nvtuan {type} {code} {path}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Command description';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return mixed
|
|
* @throws \Exception
|
|
*/
|
|
public function handle()
|
|
{
|
|
// dump($this->arguments());exit;
|
|
//
|
|
$bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication()));
|
|
// $bilibili->checkVideoHasDownload();
|
|
|
|
// $bilibili->queryLocalUpVideoList();exit;
|
|
// $bilibili->insertDBTest();exit;
|
|
// $bilibili->queryPlayList();
|
|
|
|
// $bilibili->queryUpVideoList(10278125);
|
|
// exit;
|
|
|
|
// $bilibili->queryDBCollectionList();
|
|
// $bilibili->queryForVideoParts();
|
|
$bilibili->compareAndDownloadUpVideos(true);
|
|
// $bilibili->compareAndDownloadCollectionVideos();
|
|
exit;
|
|
$bilibili->queryForVideoParts();
|
|
if (App::environment() == "local") {
|
|
# code...
|
|
exit;
|
|
}
|
|
date_default_timezone_set('PRC');
|
|
$path = $this->argument("path");
|
|
$service = new FfmpegService();
|
|
// $service->checkFileEncodeType();exit;
|
|
$service->processDir(trim($path));
|
|
exit;
|
|
// $bilibili->compareAndDownloadUpVideos();
|
|
// exit;
|
|
// $bilibili->compareAndDownloadCollectionVideos();
|
|
// $bilibili->queryCollectionList();
|
|
// $bilibili->compareAndDownloadNewVideos();
|
|
// $bilibili->queryLocalUpVideoList();
|
|
// $bilibili->queryForVideoParts();
|
|
// $bilibili->queryDBCollectionList();
|
|
// $bilibili->checkVideoHasDownload();
|
|
// echo is_dir("/Volumes/Seagate Backup Plus Drive/Video/bilibili/少女时代");
|
|
|
|
}
|
|
}
|