You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

86 lines
2.4 KiB

<?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;
use Illuminate\Support\Facades\Redis;
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()
{
$bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication()));
// $bilibili->checkVideoHasDownload();
// $bilibili->queryLocalUpVideoList();exit;
// $bilibili->insertDBTest();exit;
// $bilibili->queryPlayList();
$bilibili->queryUpVideoList(10278125);
// exit;
// $bilibili->queryDBCollectionList();
// dump($bilibili->requestVideoParts("33483603"));exit;
$bilibili->queryForVideoParts();exit;
$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/少女时代");
}
}