compareLocalFilesAndGooglePhotoFiles();exit; // echo App::environment();exit; // $list = BilibiliVideos::where("created_at", ">", "2021-09-09 00:00:00")->get(); // dump($list[0]->getAttributes());exit; date_default_timezone_set('PRC'); $path = $this->argument("path"); $service = new FfmpegService(); $needDeleteAfterEncode = $this->argument("needDeleteAfterEncode"); if (trim($needDeleteAfterEncode) == "1") { $service->setNeedRemoveAfterEncode(true); } $needDeleteExistFiles = $this->argument("needDeleteExistFiles"); if (trim($needDeleteExistFiles) == "1") { $service->setNeedRemoveExistFiles(true); } // $service->checkFileEncodeType();exit; $service->processDir(trim($path));exit; $cache = Cache::driver("redis"); $cache->tags(["aaa", "bbb"])->put("key1", "value1"); $cache->put("key2", "value2"); exit; $this->testAnnie();exit; $commonScrapeService = new CommonScrapeService(); $commonScrapeService->scrapeAlbum();exit; dump(FileUtils::scanDuplicateDir("/Volumes/intel660p/image/xg/ycc"));exit; $fileService = new FileService(); $fileService->segmentFiles("/Volumes/Samsung/weibo/old_image"); exit; // Redis::set("hello", "123"); echo Redis::get("fullSet"); exit; echo mb_strlen("霸气欣欣爷,内地画师,兼职推女神模特,毕业于广州美术学院国画系,自称广州沙画师彩绘师欣儿,一位猫咪爱好%E8");exit; setlocale(LC_ALL,array('zh_CN.gbk','zh_CN.gb2312','zh_CN.gb18030')); setlocale(LC_ALL, "zh_CN.UTF-8"); $p1 = pathinfo('D:\\atlas\\这是文件夹\\可爱胖胖是怎么变帅的#超能陆战队.mp4'); $p2 = pathinfo('D:\\atlas\\dirname\\sssss#ddddd.mp4'); print_r($p1); print_r($p2); // } public function testAnnie() { $result = shell_exec("annie -i av417536178"); echo $result; preg_match_all("#\[(\d+)\]\s+-+\s+Quality:\s+[\S]+\s+720P#", $result, $match); dump($match); } /** * 重命名因 handbrake 编码后自动添加数字的文件 * @param $path * @return bool */ public function renameHandBrakeRenamedFiles($path) { $files = scandir($path); foreach ($files as $file) { if ($file == "." || $file == "..") { continue; } preg_match_all("/(\s\d+)\.mp4/", $file, $matches); if (array_key_exists(1, $matches) && array_key_exists(0, $matches[1])) { $newFileName = str_replace($matches[0][0], ".mp4", $file); rename($path . "/" . $file, $path . "/" . $newFileName); // dump($path . "/" . $newFileName); } // dump($matches); } } }