diff --git a/.env.local b/.env.local index 152dc81..591553d 100644 --- a/.env.local +++ b/.env.local @@ -59,3 +59,6 @@ OAUTH_AUTHORIZE_ENDPOINT=/oauth2/v2.0/authorize OAUTH_TOKEN_ENDPOINT=/oauth2/v2.0/token albums_authentication_redirect_url=http://localhost:1234/google/photo/connect + +APP_TIMEZONE='Asia/Singapore' + diff --git a/app/Console/Commands/BiliVideoCode.php b/app/Console/Commands/BiliVideoCode.php index 22f9e24..b9731f7 100644 --- a/app/Console/Commands/BiliVideoCode.php +++ b/app/Console/Commands/BiliVideoCode.php @@ -15,7 +15,7 @@ class BiliVideoCode extends Command { * * @var string */ - protected $signature = 'bili:nvtuan {type} {code} {path} {startPos=0}'; + protected $signature = 'bili:nvtuan {type} {code} {path} {startPos=0} {limit=20}'; /** * The console command description. @@ -41,10 +41,11 @@ class BiliVideoCode extends Command { */ public function handle() { $bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication())); -// $startPos = $this->argument("startPos"); -// echo "startPos is $startPos"; -// $bilibili->queryUpVideoList(10278125, $startPos); -// exit; + $startPos = $this->argument("startPos"); + $limit = $this->argument("limit"); + echo "startPos is $startPos"; + $bilibili->queryUpVideoList(10278125, $startPos, $limit); + exit; $bilibili->downloadDynamics();exit; $browserFactory = new \HeadlessChromium\BrowserFactory(); diff --git a/app/Console/Commands/RenameTest.php b/app/Console/Commands/RenameTest.php index 93dc7ee..26d8d4c 100644 --- a/app/Console/Commands/RenameTest.php +++ b/app/Console/Commands/RenameTest.php @@ -42,6 +42,7 @@ class RenameTest extends Command { $level = $this->argument("level"); $rename = new RenameService(); $rename->setNameLevel(intval($level)); +// renameFileReplaceUseUpperFolderName($path, "_MetArt");exit; // $this->renameContainSymbol($path);exit; // $rename->rename($path, $prefix); @@ -53,8 +54,8 @@ class RenameTest extends Command { // dump($arr);exit; // $rename->rename($path, $prefix); // recursiveProcessFirstLevelDirectory($path);exit; - // processFirstLevelDirectory($path);exit; - $rename->splitCustomSizeOfFolder($path, $prefix, 500); +// processFirstLevelDirectory($path);exit; + $rename->splitCustomSizeOfFolder($path, $prefix, 500, 33); exit; // $rename->rename("/Volumes/WD/tmp/写真图/猫九", "猫九-"); @@ -93,16 +94,17 @@ class RenameTest extends Command { public function renameContainSymbol($path, $symbol = '?') { $symbol = "\u{FF1F}"; + $symbol = "?"; // echo $symbol;exit; // $file1 = "请问,这是长胖了吗?--u0bqNwYlvogx089LkDLwLK010412007dnt0E010.mp4"; // echo strpos($file1, $symbol);exit; $files = scandir($path); foreach ($files as $file) { -// echo $file . "\n"; + echo $file . "\n"; if (strpos($file, $symbol)) { $newFileName = str_replace($symbol, " ", $file); echo "now rename {$file} to " . $newFileName . "\n"; - rename($path . DIRECTORY_SEPARATOR . $file, $path . DIRECTORY_SEPARATOR . $newFileName); + // echo "result is " . rename($path . DIRECTORY_SEPARATOR . $file, $path . DIRECTORY_SEPARATOR . $newFileName); } } } diff --git a/app/Console/Commands/TestCommand.php b/app/Console/Commands/TestCommand.php index b74cebb..524e1f9 100644 --- a/app/Console/Commands/TestCommand.php +++ b/app/Console/Commands/TestCommand.php @@ -42,8 +42,8 @@ class TestCommand extends Command { * @return mixed */ public function handle() { - $this->sqlGenerate();exit; -// $this->test11();exit; +// $this->sqlGenerate();exit; + // $this->test11();exit; // $this->test10();exit; // $this->test09();exit; // $this->test08();exit; @@ -249,7 +249,7 @@ class TestCommand extends Command { // $baseDir = "/Volumes/Crucial X6/就是阿朱啊/就是阿朱啊-5"; // $dirs = ["阿朱_2010"]; $baseDir = "/Users/shixuesen/Documents/otherSync/very"; - $dirs = ["mv5002"]; + $dirs = ["QQ_Pic2"]; // $f1 = "._{CCE5795D-9D78-5CF9-64C4-F170BD9A943E}(1).jpg"; // echo starts_with($f1, "._");exit; diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 39cd51b..e265d23 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -18,6 +18,7 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use App\Services\InstagramService; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\App; +use Illuminate\Support\Facades\Redis; date_default_timezone_set('PRC'); @@ -41,21 +42,28 @@ class Kernel extends ConsoleKernel protected function schedule(Schedule $schedule) { $schedule->call(function () { - $bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication())); - Log::info("schedule queryUpVideoList started at: ". date("Y-m-d H:i:s")); - $bilibili->queryUpVideoList(); +// $bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication())); +// Log::info("schedule queryUpVideoList started at: ". date("Y-m-d H:i:s")); +// $bilibili->queryUpVideoList(); })->dailyAt("14:50"); $schedule->call(function () { - $bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication())); - Log::info("schedule queryDBCollectionList started at: ". date("Y-m-d H:i:s")); - $bilibili->queryDBCollectionList(); +// $bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication())); +// Log::info("schedule queryDBCollectionList started at: ". date("Y-m-d H:i:s")); +// $bilibili->queryDBCollectionList(); })->dailyAt("14:55"); // })->yearly(); $schedule->call(function () { - $bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication())); - Log::info("schedule queryForVideoParts started at: ". date("Y-m-d H:i:s")); - $bilibili->queryForVideoParts(); +// $bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication())); +// Log::info("schedule queryForVideoParts started at: ". date("Y-m-d H:i:s")); +// $bilibili->queryForVideoParts(); })->dailyAt("15:20"); + $schedule->call(function () { +// $bilibili = new BilibiliServiceV2(new BilibiliVideoRepository(App::getFacadeApplication())); +// Log::info("schedule queryForVideoParts started at: ". date("Y-m-d H:i:s")); +// $bilibili->queryForVideoParts(); + Redis::connection()->set("stopFlag", "1"); +// Log::info("========================= echo here ====================="); + })->dailyAt("03:20"); // $schedule->call(function () { diff --git a/app/Services/BilibiliServiceV2.php b/app/Services/BilibiliServiceV2.php index b1fd760..b0f707c 100644 --- a/app/Services/BilibiliServiceV2.php +++ b/app/Services/BilibiliServiceV2.php @@ -36,6 +36,19 @@ class BilibiliServiceV2 { // private $remoteDir = "/data/"; private $remoteDir = "/Volumes/Crucial X6/Video/"; + // 是否只根据视频数量,不尝试抓取第一页 + private $skipFirstPage = true; + + public function isSkipFirstPage(): bool + { + return $this->skipFirstPage; + } + + public function setSkipFirstPage(bool $skipFirstPage): void + { + $this->skipFirstPage = $skipFirstPage; + } + private $mixinKeyEncTab = [ 46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5, 49, 33, 9, 42, 19, 29, 28, 14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55, 40, @@ -97,7 +110,7 @@ class BilibiliServiceV2 { * @param int $mediaId * @throws Exception */ - public function queryUpVideoList($mediaId = 320491072, $startPos = 0) { + public function queryUpVideoList($mediaId = 320491072, $startPos = 0, $limit = 20) { Log::info("schedule queryUpVideoList inner started at: " . date("Y-m-d H:i:s")); // 475250 kyokyo @@ -113,19 +126,24 @@ class BilibiliServiceV2 { $list = BilibiliUpVideos::where("id", "<=", "150") ->orderBy('id', 'desc') ->offset($startPos) - ->limit(150) + ->limit($limit) ->get(); // $list = $list->slice(5); foreach ($list as $key => $item) { Log::info("schedule queryUpVideoList current up is {$item['up_name']}, started at: " . date("Y-m-d H:i:s")); // $files = scandir($this->baseDir . "bilibili/" . $item['up_name']); + $todayCount = $this->queryUpVideoTotalWithCache($item["mid"]); + if ($todayCount <= $item["count"]) { + Log::info("today new count is {$todayCount} is same or smaller than {$item["count"]} skip"); + continue; + } $mediaId = $item['mid']; $videos = []; $pageNo = 1; $url = "https://api.bilibili.com/x/space/wbi/arc/search?mid={$mediaId}&ps=30&tid=0&keyword=&pn="; - $pageAll = 3; + $pageAll = ceil($todayCount - $item["count"])/30; // if ($mediaId == 241804522 || $mediaId == 3461581333596856) { // $pageAll = 10; // } @@ -146,11 +164,19 @@ class BilibiliServiceV2 { for ($i = 1; $i < $pageAll; $i++) { $curl = curl_init(); $b_nut = time(); + $dmImgStr = str_replace("==", "", base64_encode($this->randFloat())) ; + $dmImgStr = "V2ViR0wgMS4wIChPcGVuR0wgRVMgMi4wIENocm9taXVtKQ"; + $dmCoverImgStr = str_replace("==", "", base64_encode($this->randFloat())) ; + $dmCoverImgStr = "QU5HTEUgKEludGVsIEluYy4sIEludGVsKFIpIElyaXMoVE0pIFBsdXMgR3JhcGhpY3MgNjU1LCBPcGVuR0wgNC4xKUdvb2dsZSBJbmMuIChJbnRlbCBJbmMuKQ"; +// echo $dmImgStr . "\n"; +// echo $dmCoverImgStr . "\n";exit; + $encrypt_string = "dm_cover_img_str={$dmCoverImgStr}&dm_img_list=%5B%5D&dm_img_str={$dmImgStr}&keyword=&mid={$mediaId}&order=pubdate&order_avoided=true&platform=web&pn={$i}&ps=30&tid=&web_location="; + $query = $this->build_params($encrypt_string); $params = [ "mid" => $mediaId, "ps" => 30, - "tid" => 0, + "tid" => '', "keyword" => "", "order" => "pubdate", "platform" => "web", @@ -158,37 +184,56 @@ class BilibiliServiceV2 { "order_avoided" => 'true', "pn" => $i, "dm_img_list" => [], - "dm_img_str" => "V2ViR0wgMS4wIChPcGVuR0wgRVMgMi4wIENocm9taXVtKQ", - "dm_cover_img_str" => "QU5HTEUgKEFwcGxlLCBBTkdMRSBNZXRhbCBSZW5kZXJlcjogQXBwbGUgTTEgUHJvLCBVbnNwZWNpZmllZCBWZXJzaW9uKUdvb2dsZSBJbmMuIChBcHBsZS", + "dm_img_str" => $dmImgStr, + "dm_cover_img_str" => $dmCoverImgStr, ]; - $query = $this->build_params($params); +// $query = $this->build_params($params); // echo $query;exit; - curl_setopt_array($curl, array( - CURLOPT_URL => "https://api.bilibili.com/x/space/wbi/arc/search?$query", - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 10, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'authority' => 'api.bilibili.com', - 'accept' => '*/*', - 'accept-language' => 'zh-CN,zh;q=0.9', - 'cache-control' => 'no-cache', - 'cookie' => 'buvid3=6762D2D6-7F1F-C365-7CF3-32B699342EE983582infoc;', - 'origin' => 'https://space.bilibili.com', - 'pragma' => 'no-cache', - 'referer' => 'https://space.bilibili.com/385079033/', - 'sec-ch-ua' => '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"', - 'sec-ch-ua-mobile' => '?0', - 'sec-ch-ua-platform' => '"macOS"', - 'sec-fetch-dest' => 'empty', - 'sec-fetch-mode' => 'cors', - 'sec-fetch-site' => 'same-site', - 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'), - )); +// $opts = array('http' => array('header' => '"User-Agent": "Mozilla/5.0"\r\n "origin": "https://space.bilibili.com\r\n "accept-language":"en,zh-CN;q=0.9,zh;q=0.8"\r\n')); + +// $ctx = stream_context_create($opts); +// echo file_get_contents("https://api.bilibili.com/x/space/wbi/arc/search?" . $query["new"], false, $ctx); +// exit; + $url = "https://api.bilibili.com/x/space/wbi/arc/search?" . $query["new"]; + $header[] = "Accept: */*"; + $header[] = "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7"; + $header[] = "Connection: close"; + $header[] = "Cache-Control: max-age=0"; + curl_setopt_array($curl, [ + CURLOPT_HTTPGET => 1, + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_RETURNTRANSFER => 1, + CURLOPT_HTTPHEADER => $header, + CURLOPT_ENCODING => '', + CURLOPT_URL => $url, + CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Edg/102.0.1245.39', + CURLOPT_TIMEOUT => 15 + ]); +// curl_setopt_array($curl, array( +// CURLOPT_URL => "https://api.bilibili.com/x/space/wbi/arc/search?" . $query["new"], +// CURLOPT_RETURNTRANSFER => true, +//// CURLOPT_ENCODING => '', +//// CURLOPT_MAXREDIRS => 10, +//// CURLOPT_TIMEOUT => 10, +//// CURLOPT_FOLLOWLOCATION => true, +//// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, +// CURLOPT_CUSTOMREQUEST => 'GET', +// CURLOPT_HTTPHEADER => array( +//// 'authority' => 'api.bilibili.com', +//// 'accept' => '*/*', +//// 'accept-language' => 'en,zh-CN;q=0.9,zh;q=0.8', +//// 'cache-control' => 'no-cache', +// 'origin' => 'https://space.bilibili.com', +//// 'pragma' => 'no-cache', +//// 'referer' => 'https://space.bilibili.com/385079033/', +//// 'sec-ch-ua' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36', +//// 'sec-ch-ua-mobile' => '?0', +//// 'sec-ch-ua-platform' => '"macOS"', +//// 'sec-fetch-dest' => 'empty', +//// 'sec-fetch-mode' => 'cors', +//// 'sec-fetch-site' => 'same-site', +// 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36'), +// )); $response = curl_exec($curl); $err = curl_error($curl); @@ -208,7 +253,8 @@ class BilibiliServiceV2 { $count = Arr::get(Arr::get($result["data"], "page", []), "count", 0); Log::info("up {$item["up_name"]} count is {$count}"); $result = Arr::get($result["data"]["list"], "vlist", []); - if (count($result) > 0 && $count > $item["count"] + ($i - 1) * 30) { + if (count($result) > 0 ) { + // && $count > $item["count"] + ($i - 1) * 30 foreach ($result as $vItem) { $bVideo = BilibiliVideos::firstOrCreate(["aid" => $vItem["aid"]], [ @@ -248,6 +294,55 @@ class BilibiliServiceV2 { } + public function queryUpVideoTotalWithCache($mid) + { + $today = date("Y-m-d"); + $todayCount = Redis::connection()->get("bilibili:count:{$today}:{$mid}"); + if ($todayCount == null) { + $todayCount = $this->queryUpVideoTotal($mid); + Redis::connection()->set("bilibili:count:{$today}:{$mid}", $todayCount); + } + return $todayCount; + } + + /** + * @throws Exception + */ + public function queryUpVideoTotal($mid) + { + $url = "https://api.bilibili.com/x/space/navnum?mid=" . $mid; + $curl = curl_init(); + $header[] = "Accept: */*"; + $header[] = "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7"; + $header[] = "Connection: close"; + $header[] = "Cache-Control: max-age=0"; + curl_setopt_array($curl, [ + CURLOPT_HTTPGET => 1, + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_RETURNTRANSFER => 1, + CURLOPT_HTTPHEADER => $header, + CURLOPT_ENCODING => '', + CURLOPT_URL => $url, + CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Edg/102.0.1245.39', + CURLOPT_TIMEOUT => 15 + ]); + $response = curl_exec($curl); + $err = curl_error($curl); + + curl_close($curl); + + if ($err) { + echo "cURL Error #:" . $err; + } else { + $res = json_decode($response, true); + if (array_key_exists("data", $res) && array_key_exists("video", $res["data"])) { + return $res["data"]["video"]; + } else { + throw new Exception("获取up 视频数量异常"); + } + } + } + /** * 手动执行查询 * @param int $mediaId @@ -1193,7 +1288,7 @@ done && echo "ok"'); public function downloadDynamics() { $env = App::environment(); - $list = BilibiliUpVideos::orderBy("id", "desc")->where("id", "<", "18")->limit(150)->get(); + $list = BilibiliUpVideos::orderBy("id", "desc")->where("id", ">=", "18")->limit(150)->get(); foreach ($list as $item) { $mid = $item["mid"]; $offset = null; @@ -1273,7 +1368,7 @@ done && echo "ok"'); 'accept' => '*/*', 'accept-language' => 'zh-CN,zh;q=0.9', 'cache-control' => 'no-cache', - 'cookie' => 'innersign=0; buvid3=B1AC74D2-4E44-6375-C8DE-2353496EED4C42220infoc; b_nut=1701997942; i-wanna-go-back=-1; b_ut=7; b_lsid=F714DB9B_18C46FB976D; _uuid=FF6D106110-8DB5-1C71-44EB-32184A3BEC4342646infoc; buvid_fp=c5a0925654a4d29703d7e58e5c7dd718; enable_web_push=DISABLE; header_theme_version=undefined; home_feed_column=5; browser_resolution=1512-827; buvid4=F072E4A8-E4DE-2651-EB97-CA3A11CB7D5744004-023120801-', + 'cookie' => 'buvid3=EF29B60A-6AA9-0563-A2FA-D92BEFC1B23067735infoc; b_nut=1702217967; b_lsid=2CFDCA64_18C5418E9FE; _uuid=4561010248-344A-4CFE-10D62-6BD31267D5A268133infoc; buvid4=6AF2B782-95B2-B1CF-0490-15EE12B63F7868264-023121014-; buvid_fp=16ca7877abf814d5ed71dfd8c26f15d7; bili_ticket=eyJhbGciOiJIUzI1NiIsImtpZCI6InMwMyIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDI0NzcxNjksImlhdCI6MTcwMjIxNzkwOSwicGx0IjotMX0.y__-5e5q6Nhk_MpRZeLd9CIYw6xdwnmuv4OzA5qKVqw; bili_ticket_expires=1702477109', 'origin' => 'https://space.bilibili.com', 'pragma' => 'no-cache', 'referer' => 'https://space.bilibili.com/385079033/dynamic', @@ -1325,15 +1420,32 @@ done && echo "ok"'); $mixin_key = $this->getMixinKey($img_key . $sub_key); $curr_time = round(time()); $params['wts'] = $curr_time; // 添加 wts 字段 -// ksort($params); // 按照 key 重排参数 + ksort($params); // 按照 key 重排参数 $params = array_map(function ($v) { return preg_replace("#[!'()*/]#", '', $v); // 过滤 value 中的 "!'()*" 字符 }, $params); $query = http_build_query($params); // 序列化参数 + $query = str_replace("&dm_img_str", "&dm_img_list=%5B%5D&dm_img_str", $query); +// echo $query;exit; $wbi_sign = md5($query . $mixin_key); // 计算 w_rid $params['w_rid'] = $wbi_sign; return $params; } + + public function encWbiString($paramString, $img_key, $sub_key) + { + $mixin_key = $this->getMixinKey($img_key . $sub_key); + $curr_time = round(time()); + $wts = $curr_time; // 添加 wts 字段 +// echo "before $paramString \n"; +// preg_replace("#[!'()*/]#", '', $paramString); +// echo "after $paramString \n"; + $wbi_sign = md5($paramString . "&wts=" . $wts . $mixin_key); // 计算 w_rid +// echo "\n wbi sign is $wbi_sign \n";exit; + $params['w_rid'] = $wbi_sign; + $params["new"] = $paramString . "&w_rid=" . $wbi_sign . "&wts=" . $wts; + return $params; + } public function getWbiKeys() { $img_key = Redis::connection()->get("img_key"); $sub_key = Redis::connection()->get("sub_key"); @@ -1355,15 +1467,24 @@ done && echo "ok"'); public function build_params($params) { list($img_key, $sub_key) = $this->getWbiKeys(); // dump($img_key); - // dump($sub_key); - $signed_params = $this->encWbi( - $params, - $img_key, - $sub_key - ); +// dump($sub_key); + if (gettype($params) == "string") { + $query = $this->encWbiString($params, $img_key, $sub_key); + } else { + $signed_params = $this->encWbi( + $params, + $img_key, + $sub_key + ); // dump($signed_params);exit; - $query = http_build_query($signed_params); + $query = http_build_query($signed_params); + } + // print_r($signed_params); return $query; } + + public function randFloat($min=0, $max=1){ + return $min + mt_rand()/mt_getrandmax() * ($max-$min); + } } diff --git a/app/Services/InstagramService.php b/app/Services/InstagramService.php index fa45315..485e498 100644 --- a/app/Services/InstagramService.php +++ b/app/Services/InstagramService.php @@ -31,6 +31,8 @@ class InstagramService { private const TODAY_USER_KEY = "recent_ins"; + private const TODAY_MAX_ID = "today_max_id"; + public function __construct() { // $this->ig = new Instagram($this->debug, $this->truncatedDebug); @@ -1268,10 +1270,19 @@ class InstagramService { $baseImageDir = "/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/"; try { // $maxId = "KLYBARoAIAGQAGgASAAwACAAGAAQAAgACAAIAAgACABjuCa_l9v-dr3zx9F7Xp3d-L1r6Vo3DXT_6R-tfP2empv10y5ZsWklYjcXJGpsa50zvaA350LlHBg6cDmivafrIrGQn7gexjClt1_a0r7vgPD6h-s5v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LPy3fxz45-I43LeK3NJ7VtT0t47u9j776Py3o9y8MPDg3Lennp98gZDkt86MvbD93Py30Wy4e0_I-LfWjhD9Eoj4t9muty6r4Py33L79YS7U-LQA"; $maxId = null; + if (Redis::connection()->get(self::TODAY_MAX_ID) != null) { + // code... + $maxId = Redis::connection()->get(self::TODAY_MAX_ID); + + } do { $response = $this->queryTimeLineSingle($maxId); // Log::info("response: " . $response->asJson()); + Redis::connection()->set(self::TODAY_MAX_ID, $response->getNextMaxId()); + $lastSeconds = strtotime(date("Y-m-d 23:59:59")); + Redis::connection()->expireat(self::TODAY_MAX_ID, $lastSeconds); foreach ($response->getFeedItems() as $item) { if ($item->getMediaOrAd() == null || $item->getMediaOrAd()->getProductType() == "ad") { continue; @@ -2202,24 +2213,24 @@ class InstagramService { 'accept-language' => 'zh-CN,zh;q=0.9', 'cache-control' => 'no-cache', 'content-type' => 'application/x-www-form-urlencoded', - 'cookie' => 'ds_user_id=361404591; fbm_124024574287414=base_domain=.instagram.com; ig_did=B118EB65-DCA3-47C7-BFD9-36AE91644AA2; datr=WV9UZdg4SM4SuzFpXR8wCv99; mid=ZVRfXQAEAAFUwW22kaeJsldDuWyn; csrftoken=zVdcURfwVjcy4n8VyxhaE6R2eZ3cm5hy; sessionid=361404591%3AXJ0sNXYIJF8fqD%3A13%3AAYcxobmvAGJexkUzLkcsYYVTBNrO_s0AdEEppZkWX4M; fbsr_124024574287414=kMDZo9Rp6MT1o2D34zQOKQ8LiB4FTIjFZWjW4c57Dwo.eyJ1c2VyX2lkIjoiMTAwMDA3ODU5ODI1MDQ3IiwiY29kZSI6IkFRQnM0X0FhcHBWQWstMTZBamxUZFMzZEtXRXh6Q1NxX0RYYTMxdUtWSEtpTFVSbjh5T2FXSlpZamp1NXJPZTVvNWJvWUd5YXFfaVZ6RDFRaEd2NGVRdklkWHhvZ3d4UTZobVMxdXJKbVFfbVFqdVp5OXkwTXF6OU1vTS1tSFNld0NYN0I1aUlSNnF5dkNqamdYVE5MNE05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0ZOMldKbkszNWYySlRiWW5JQXZYTkhDOHNidkZhemJkNkJMamVfS3lWX0pTNm5OcHFMREp3UDFWM3JYV3NYZ3VNb2VWV3dnSlpEdEdQNngzSnd2Z2doX3NDc2hNIiwib2F1dGhfdG9rZW4iOiJFQUFCd3pMaXhuallCT3hvOVR3T0o4YUVnZ2V3eFZJS1VuNjZFQTRaQThteFpBNk5nUUt1M3JUTU0zaG5XSG9pMlhEdU9JdFpBRGlwcURnYUNoMTdFb09aQVZxUUFpSHdwcjRKYXVjcXF2UjByYWt0VnlURzBLS3dwQmJ4NDFCVUY1UDZkSjZaQjVWak9JY1ZrS0lKRlpBRHVUSkU2WWZ6NnBENDNBaDh3NHZ2eVF3ZHFsMjcwajZyRWZOUjZJNEs2WkNGWkJSWVpEIiwiYWxnb3JpdGhtIjoiSE1BQy1TSEEyNTYiLCJpc3N1ZWRfYXQiOjE3MDE5OTc1NjV9; shbid="13821\\054361404591\\0541733533565:01f70629712c4a079173e71418c82fd6d25e8fe6eb5423c9d53bc66963cfb4a272ff64c0"; shbts="1701997565\\054361404591\\0541733533565:01f788989dfd5aa12c56627ad5d85168f4297236b490ce9d35cb042ec56b62da8a7bca3b"; rur="VLL\\054361404591\\0541733533565:01f7923c155121dc9276048ffe2622c06be4cdf12b8fc3652b4e24931aac5e90196d1a22"', + 'cookie' => 'ds_user_id=361404591; fbm_124024574287414=base_domain=.instagram.com; ig_did=B118EB65-DCA3-47C7-BFD9-36AE91644AA2; datr=WV9UZdg4SM4SuzFpXR8wCv99; mid=ZVRfXQAEAAFUwW22kaeJsldDuWyn; csrftoken=6j03rM6kESRVu2HCxHMDMbvSHYiuCxPr; shbid="13821\\054361404591\\0541735000838:01f7b5c2ef2ebc372fe7386971c2d11577a68818dd83da1bf23a61e35f8720255ed2b469"; shbts="1703464838\\054361404591\\0541735000838:01f716c7a832af834943428ddf125e560c060ecbaf7087c7e558388e3aea8749469cf585"; sessionid=361404591%3AwxOmaVLxhosXDw%3A13%3AAYdmYzB4wDUqRdV_6D1WH28ri9YwNHa-kcM8zWslRg; rur="NAO\\054361404591\\0541735016697:01f7f3cc9aa01dcb40fe8f8afd9b168541ca982560304007bed146f665ba041925d95b32"', 'origin' => 'https://www.instagram.com', 'pragma' => 'no-cache', 'referer' => 'https://www.instagram.com/cho_hyunyoung/', 'sec-ch-prefers-color-scheme' => 'light', - 'sec-ch-ua' => '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"', - 'sec-ch-ua-full-version-list' => '"Google Chrome";v="119.0.6045.199", "Chromium";v="119.0.6045.199", "Not?A_Brand";v="24.0.0.0"', + 'sec-ch-ua' => '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"', + 'sec-ch-ua-full-version-list' => '"Not_A Brand";v="8.0.0.0", "Chromium";v="120.0.6099.129", "Google Chrome";v="120.0.6099.129"', 'sec-ch-ua-mobile' => '?0', 'sec-ch-ua-platform' => '"macOS"', 'sec-ch-ua-platform-version' => '"12.6.0"', 'sec-fetch-dest' => 'empty', 'sec-fetch-mode' => 'cors', 'sec-fetch-site' => 'same-origin', - 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36', + 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'x-asbd-id' => '129477', - 'x-csrftoken' => 'zVdcURfwVjcy4n8VyxhaE6R2eZ3cm5hy', + 'x-csrftoken' => '6j03rM6kESRVu2HCxHMDMbvSHYiuCxPr', 'x-ig-app-id' => '936619743392459', - 'x-ig-www-claim' => 'hmac.AR2DN3JP5T1uzerp-Udyl58luFekDMO1MUYZolRys4KAvO71', + 'x-ig-www-claim' => 'hmac.AR2DN3JP5T1uzerp-Udyl58luFekDMO1MUYZolRys4KAvMOk', 'x-instagram-ajax' => '1007675716', 'x-requested-with' => 'XMLHttpRequest', ]; @@ -2238,7 +2249,7 @@ class InstagramService { $request = new Request('POST', 'https://i.instagram.com/api/v1/feed/timeline/', $headers); $res = $client->sendAsync($request, $options)->wait(); $resStr = $res->getBody(); - // echo $resStr; +// echo $resStr; $jsonArray = @json_decode($resStr, true, 512, JSON_BIGINT_AS_STRING); $response = new Response\TimelineFeedResponse(); $response->assignObjectData($jsonArray); @@ -2294,13 +2305,13 @@ class InstagramService { 'accept' => '*/*', 'accept-language' => 'zh-CN,zh;q=0.9', 'cache-control' => 'no-cache', - 'cookie' => 'ds_user_id=361404591; fbm_124024574287414=base_domain=.instagram.com; ig_did=B118EB65-DCA3-47C7-BFD9-36AE91644AA2; datr=WV9UZdg4SM4SuzFpXR8wCv99; mid=ZVRfXQAEAAFUwW22kaeJsldDuWyn; csrftoken=zVdcURfwVjcy4n8VyxhaE6R2eZ3cm5hy; sessionid=361404591%3AXJ0sNXYIJF8fqD%3A13%3AAYcxobmvAGJexkUzLkcsYYVTBNrO_s0AdEEppZkWX4M; fbsr_124024574287414=kMDZo9Rp6MT1o2D34zQOKQ8LiB4FTIjFZWjW4c57Dwo.eyJ1c2VyX2lkIjoiMTAwMDA3ODU5ODI1MDQ3IiwiY29kZSI6IkFRQnM0X0FhcHBWQWstMTZBamxUZFMzZEtXRXh6Q1NxX0RYYTMxdUtWSEtpTFVSbjh5T2FXSlpZamp1NXJPZTVvNWJvWUd5YXFfaVZ6RDFRaEd2NGVRdklkWHhvZ3d4UTZobVMxdXJKbVFfbVFqdVp5OXkwTXF6OU1vTS1tSFNld0NYN0I1aUlSNnF5dkNqamdYVE5MNE05NzF6bjVqZC1NeFMzcEZYTEttYWFDd0tBaTdYOHhTZHpzeFJ6RXlEcW5LMHdMOUU1QVM2Q0RLVVB3RTJQY2M5TXduUHNnUXQzNjItTEhid3hLLV9PU1BlbWg5cFMyTmhPeFg1M19NOWtrRmdHNWUxQ1pKMmZVY0dBY08za0ItaDlwUUxScVJUeFVJRWlLcHNVV1J0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ThteFpBNk5nUUt1M3JUTU0zaG5XSG9pMlhEdU9JdFpBRGlwcURnYUNoMTdFb09aQVZxUUFpSHdwcjRKYXVjcXF2UjByYWt0VnlURzBLS3dwQmJ4NDFCVUY1UDZkSjZaQjVWak9JY1ZrS0lKRlpBRHVUSkU2WWZ6NnBENDNBaDh3NHZ2eVF3ZHFsMjcwajZyRWZOUjZJNEs2WkNGWkJSWVpEIiwiYWxnb3JpdGhtIjoiSE1BQy1TSEEyNTYiLCJpc3N1ZWRfYXQiOjE3MDE5OTc1NjV9; shbid="13821\\054361404591\\0541733533565:01f70629712c4a079173e71418c82fd6d25e8fe6eb5423c9d53bc66963cfb4a272ff64c0"; shbts="1701997565\\054361404591\\0541733533565:01f788989dfd5aa12c56627ad5d85168f4297236b490ce9d35cb042ec56b62da8a7bca3b"; rur="VLL\\054361404591\\0541733533565:01f7923c155121dc9276048ffe2622c06be4cdf12b8fc3652b4e24931aac5e90196d1a22"', + 'cookie' => 'ds_user_id=361404591; fbm_124024574287414=base_domain=.instagram.com; ig_did=B118EB65-DCA3-47C7-BFD9-36AE91644AA2; datr=WV9UZdg4SM4SuzFpXR8wCv99; mid=ZVRfXQAEAAFUwW22kaeJsldDuWyn; csrftoken=6j03rM6kESRVu2HCxHMDMbvSHYiuCxPr; shbid="13821\\054361404591\\0541735000838:01f7b5c2ef2ebc372fe7386971c2d11577a68818dd83da1bf23a61e35f8720255ed2b469"; shbts="1703464838\\054361404591\\0541735000838:01f716c7a832af834943428ddf125e560c060ecbaf7087c7e558388e3aea8749469cf585"; sessionid=361404591%3AwxOmaVLxhosXDw%3A13%3AAYdmYzB4wDUqRdV_6D1WH28ri9YwNHa-kcM8zWslRg; rur="NAO\\054361404591\\0541735016697:01f7f3cc9aa01dcb40fe8f8afd9b168541ca982560304007bed146f665ba041925d95b32"', 'dpr' => '2', 'pragma' => 'no-cache', 'referer' => 'https://www.instagram.com/cho_hyunyoung/', 'sec-ch-prefers-color-scheme' => 'light', - 'sec-ch-ua' => '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"', - 'sec-ch-ua-full-version-list' => '"Google Chrome";v="119.0.6045.199", "Chromium";v="119.0.6045.199", "Not?A_Brand";v="24.0.0.0"', + 'sec-ch-ua' => '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"', + 'sec-ch-ua-full-version-list' => '"Not_A Brand";v="8.0.0.0", "Chromium";v="120.0.6099.129", "Google Chrome";v="120.0.6099.129"', 'sec-ch-ua-mobile' => '?0', 'sec-ch-ua-model' => '""', 'sec-ch-ua-platform' => '"macOS"', @@ -2308,12 +2319,12 @@ class InstagramService { 'sec-fetch-dest' => 'empty', 'sec-fetch-mode' => 'cors', 'sec-fetch-site' => 'same-origin', - 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36', + 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'viewport-width' => '1512', 'x-asbd-id' => '129477', - 'x-csrftoken' => 'zVdcURfwVjcy4n8VyxhaE6R2eZ3cm5hy', + 'x-csrftoken' => '6j03rM6kESRVu2HCxHMDMbvSHYiuCxPr', 'x-ig-app-id' => '936619743392459', - 'x-ig-www-claim' => 'hmac.AR2DN3JP5T1uzerp-Udyl58luFekDMO1MUYZolRys4KAvO71', + 'x-ig-www-claim' => 'hmac.AR2DN3JP5T1uzerp-Udyl58luFekDMO1MUYZolRys4KAvMOk', 'x-requested-with' => 'XMLHttpRequest', ]; $url = "https://i.instagram.com/api/v1/feed/user/{$userId}/?count=12"; diff --git a/app/Services/RenameService.php b/app/Services/RenameService.php index 7c193a1..6626d08 100644 --- a/app/Services/RenameService.php +++ b/app/Services/RenameService.php @@ -142,7 +142,7 @@ class RenameService { } } - public function splitCustomSizeOfFolder($dir = "", $prefix = "", $size = 500) { + public function splitCustomSizeOfFolder($dir = "", $prefix = "", $size = 500, $startFolderNo = 0) { $files = $this->recordAllFiles($dir, $prefix); asort($files, SORT_NUMERIC); $files = array_keys($files); @@ -150,7 +150,8 @@ class RenameService { $folderNum = ceil(count($files) / $size); for ($i = 0; $i < $folderNum; $i++) { # code... - $currentDirName = $dir . DIRECTORY_SEPARATOR . $prefix . "_00" . $i; + $currentStartNo = $i + $startFolderNo; + $currentDirName = $dir . DIRECTORY_SEPARATOR . $prefix . "_00" . $currentStartNo; if (!is_dir($currentDirName)) { mkdir($currentDirName); } diff --git a/app/Services/XiurenjiService.php b/app/Services/XiurenjiService.php index 25f5131..b270e5f 100644 --- a/app/Services/XiurenjiService.php +++ b/app/Services/XiurenjiService.php @@ -157,7 +157,7 @@ class XiurenjiService } dump("description: " . $description); } - + if ($imageNo == 1) { // 只在每个相册第一次输出名字 dump("user is " . $user); @@ -168,23 +168,68 @@ class XiurenjiService $imageUrl = $image->getAttribute("src"); $trueImageUrl = "https://www.xiurenb.net" . $imageUrl; $fileInfo = pathinfo($trueImageUrl); - if (file_exists($dir . DIRECTORY_SEPARATOR . $fileInfo["basename"])) { - rename($dir . DIRECTORY_SEPARATOR . $fileInfo["basename"], $dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["basename"]); + if (file_exists($dir . DIRECTORY_SEPARATOR . $fileInfo["filename"] . ".jpg")) { + rename($dir . DIRECTORY_SEPARATOR . $fileInfo["filename"] . ".jpg", $dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["filename"] . ".jpg"); + $imageNo++; + continue; + } + if (file_exists($dir . DIRECTORY_SEPARATOR . $fileInfo["filename"] . ".webp")) { + rename($dir . DIRECTORY_SEPARATOR . $fileInfo["filename"] . ".webp", $dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["filename"] . ".webp"); + $imageNo++; + continue; + } + + // 情况 2 缺少 user + if (file_exists($dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["filename"] . ".jpg")) { + rename($dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["filename"] . ".jpg", $dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["filename"] . ".jpg"); + $imageNo++; + continue; + } + if (file_exists($dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["filename"] . ".webp")) { + rename($dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["filename"] . ".webp", $dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["filename"] . ".webp"); $imageNo++; continue; } - if (file_exists($dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["basename"])) { - rename($dir . DIRECTORY_SEPARATOR . $imageNo . "-" . $fileInfo["basename"], $dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["basename"]); + + // 情况 3 缺少描述 + if (file_exists($dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["filename"] . ".jpg")) { + if ($description != null) { + rename($dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["filename"] . ".jpg", $dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $description . "-" . $imageNo . "-" . $fileInfo["filename"] . ".jpg"); + } $imageNo++; continue; } - if (file_exists($dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["basename"])) { + if (file_exists($dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["filename"] . ".webp")) { if ($description != null) { - rename($dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["basename"], $dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $description . "-" . $imageNo . "-" . $fileInfo["basename"]); + rename($dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $imageNo . "-" . $fileInfo["filename"] . ".webp", $dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $description . "-" . $imageNo . "-" . $fileInfo["filename"] . ".webp"); } $imageNo++; continue; } + + // 情况 4 已存在则返回 + if (file_exists($dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $description . "-" . $imageNo . "-" . $fileInfo["filename"] . ".jpg")) { + # code... + $imageNo++; + continue; + } + if (file_exists($dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $description . "-" . $imageNo . "-" . $fileInfo["basename"])) { + # code... + $imageNo++; + continue; + } + + // 情况 5 user 为空 + if (file_exists($dir . DIRECTORY_SEPARATOR . "-" . $description . "-" . $imageNo . "-" . $fileInfo["filename"] . ".jpg")) { + rename($dir . DIRECTORY_SEPARATOR . "-" . $description . "-" . $imageNo . "-" . $fileInfo["filename"] . ".jpg", $dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $description . "-" . $imageNo . "-" . $fileInfo["filename"] . ".jpg"); + $imageNo++; + continue; + } + if (file_exists($dir . DIRECTORY_SEPARATOR . "-" . $description . "-" . $imageNo . "-" . $fileInfo["basename"])) { + rename($dir . DIRECTORY_SEPARATOR . "-" . $description . "-" . $imageNo . "-" . $fileInfo["basename"], $dir . DIRECTORY_SEPARATOR . trim($user) . "-" . $description . "-" . $imageNo . "-" . $fileInfo["basename"]); + $imageNo++; + continue; + } // dump($fileInfo); $attempts = 0; $content = ""; diff --git a/app/Utils/BilibiliQueryUtil.php b/app/Utils/BilibiliQueryUtil.php new file mode 100644 index 0000000..a045670 --- /dev/null +++ b/app/Utils/BilibiliQueryUtil.php @@ -0,0 +1,108 @@ +getWbiKeys(); + return $this->encWbi($query, $wbi_keys['img_key'], $wbi_keys['sub_key']); + } + + private function getMixinKey($orig) + { + $t = ''; + foreach ($this->mixinKeyEncTab as $n) $t .= $orig[$n]; + return substr($t, 0, 32); + } + + private function encWbi($params, $img_key, $sub_key) + { + $mixin_key = $this->getMixinKey($img_key . $sub_key); + $curr_time = time(); + $chr_filter = "/[!'()*]/"; + + $query = []; + $params['wts'] = $curr_time; + + ksort($params); + + foreach ($params as $key => $value) { + $value = preg_replace($chr_filter, '', $value); + $query[] = urlencode($key) . '=' . urlencode($value); + } + + $query = implode('&', $query); + $wbi_sign = md5($query . $mixin_key); + + return $query . '&w_rid=' . $wbi_sign; + } + + private function getWbiKeys() + { + $resp = @json_decode( + $this->curl_get( + 'https://api.bilibili.com/x/web-interface/nav', + null, + 'https://www.bilibili.com/' + ), true + ); + + if (!$resp) throw new Exception('请求失败'); + + $img_url = $resp['data']['wbi_img']['img_url']; + $sub_url = $resp['data']['wbi_img']['sub_url']; + + return [ + 'img_key' => substr(basename($img_url), 0, strpos(basename($img_url), '.')), + 'sub_key' => substr(basename($sub_url), 0, strpos(basename($sub_url), '.')) + ]; + } + + private function curl_get($url, $cookies = null, $referer = 'https://www.bilibili.com/', $ua = null, $proxy = null, $header = []) + { + $ch = curl_init(); + $header[] = "Accept: */*"; + $header[] = "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7"; + $header[] = "Connection: close"; + $header[] = "Cache-Control: max-age=0"; + curl_setopt_array($ch, [ + CURLOPT_HTTPGET => 1, + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_RETURNTRANSFER => 1, + CURLOPT_HTTPHEADER => $header, + CURLOPT_ENCODING => '', + CURLOPT_URL => $url, + CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Edg/102.0.1245.39', + CURLOPT_TIMEOUT => 15 + ]); + + if ($cookies) curl_setopt( + $ch, + CURLOPT_COOKIE, + $cookies + ); + + if ($referer) curl_setopt_array($ch, [ + CURLOPT_AUTOREFERER => $referer, + CURLOPT_REFERER => $referer + ]); + + $content = curl_exec($ch); + curl_close($ch); + return $content; + } +} diff --git a/app/Utils/helper.php b/app/Utils/helper.php index cf18b5e..6635cca 100644 --- a/app/Utils/helper.php +++ b/app/Utils/helper.php @@ -4,6 +4,7 @@ use Google\Auth\Credentials\UserRefreshCredentials; use Google\Auth\HttpHandler\Guzzle7HttpHandler; use Google\Auth\OAuth2; use GuzzleHttp\Client; +use Illuminate\Support\Str; function connectWithGooglePhotos($request, array $scopes, $redirectURI) { $clientSecretJson = json_decode( @@ -243,3 +244,40 @@ function recursiveProcessInnerDirectory($dir, $lastLevelName): bool { } return true; } + +function renameFileReplaceUseUpperFolderName($baseDir, $keyword) { + $list = preProcessDirs($baseDir); + + foreach ($list as $firstDir) { + $currentDir = implode(DIRECTORY_SEPARATOR, [$baseDir, $firstDir]); + if (is_dir($currentDir)) { + $files = preProcessDirs($currentDir); + foreach ($files as $file) { + $currentFile = implode(DIRECTORY_SEPARATOR, [$currentDir, $file]); + if (is_file($currentFile) && Str::startsWith($file, $keyword) && !Str::contains($file, $firstDir)) { + $fileName = str_replace($keyword, $firstDir, $file); + $newFile = implode(DIRECTORY_SEPARATOR, [$currentDir, $fileName]); + echo "current file is " . $currentFile . " now rename to " . $newFile . "\n"; + rename($currentFile, $newFile); + } + } + } + } + +} + +function preProcessDirs($baseDir): array { + if (!is_dir($baseDir)) { + return []; + } + // 遍历内部文件 + $list = scandir($baseDir); + $result = []; + foreach ($list as $file) { + if (skipDefaultPathAndFile($file)) { + continue; + } + $result[] = $file; + } + return $result; +} diff --git a/config/app.php b/config/app.php index 3a9c778..0f64d83 100644 --- a/config/app.php +++ b/config/app.php @@ -2,230 +2,230 @@ return [ - /* - |-------------------------------------------------------------------------- - | Application Name - |-------------------------------------------------------------------------- - | - | This value is the name of your application. This value is used when the - | framework needs to place the application's name in a notification or - | any other location as required by the application or its packages. - | - */ - - 'name' => env('APP_NAME', 'Laravel'), - - /* - |-------------------------------------------------------------------------- - | Application Environment - |-------------------------------------------------------------------------- - | - | This value determines the "environment" your application is currently - | running in. This may determine how you prefer to configure various - | services the application utilizes. Set this in your ".env" file. - | - */ - - 'env' => env('APP_ENV', 'production'), - - /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | - */ - - 'debug' => env('APP_DEBUG', false), - - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ - - 'url' => env('APP_URL', 'http://localhost'), - - 'asset_url' => env('ASSET_URL', null), - - /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ - - 'timezone' => 'PRC', - - /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ - - 'locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ - - 'fallback_locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Faker Locale - |-------------------------------------------------------------------------- - | - | This locale will be used by the Faker PHP library when generating fake - | data for your database seeds. For example, this will be used to get - | localized telephone numbers, street address information and more. - | - */ - - 'faker_locale' => 'en_US', - - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ - - 'key' => env('APP_KEY'), - - 'cipher' => 'AES-256-CBC', - - 'albums_authentication_redirect_url' => env('albums_authentication_redirect_url'), - - /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ - - 'providers' => [ - - /* - * Laravel Framework Service Providers... - */ - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - Illuminate\Translation\TranslationServiceProvider::class, - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, - - /* - * Package Service Providers... - */ - - /* - * Application Service Providers... - */ - App\Providers\AppServiceProvider::class, - App\Providers\AuthServiceProvider::class, - // App\Providers\BroadcastServiceProvider::class, - App\Providers\EventServiceProvider::class, - App\Providers\RouteServiceProvider::class, - - ], - - /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | - */ - - 'aliases' => [ - - 'App' => Illuminate\Support\Facades\App::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, - 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'URL' => Illuminate\Support\Facades\URL::class, - 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, - - ], + /* + |-------------------------------------------------------------------------- + | Application Name + |-------------------------------------------------------------------------- + | + | This value is the name of your application. This value is used when the + | framework needs to place the application's name in a notification or + | any other location as required by the application or its packages. + | + */ + + 'name' => env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + 'asset_url' => env('ASSET_URL', null), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | + */ + + 'timezone' => 'Asia/Shanghai', + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | + */ + + 'locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | + */ + + 'fallback_locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Faker Locale + |-------------------------------------------------------------------------- + | + | This locale will be used by the Faker PHP library when generating fake + | data for your database seeds. For example, this will be used to get + | localized telephone numbers, street address information and more. + | + */ + + 'faker_locale' => 'en_US', + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + */ + + 'key' => env('APP_KEY'), + + 'cipher' => 'AES-256-CBC', + + 'albums_authentication_redirect_url' => env('albums_authentication_redirect_url'), + + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | + */ + + 'providers' => [ + + /* + * Laravel Framework Service Providers... + */ + Illuminate\Auth\AuthServiceProvider::class, + Illuminate\Broadcasting\BroadcastServiceProvider::class, + Illuminate\Bus\BusServiceProvider::class, + Illuminate\Cache\CacheServiceProvider::class, + Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, + Illuminate\Cookie\CookieServiceProvider::class, + Illuminate\Database\DatabaseServiceProvider::class, + Illuminate\Encryption\EncryptionServiceProvider::class, + Illuminate\Filesystem\FilesystemServiceProvider::class, + Illuminate\Foundation\Providers\FoundationServiceProvider::class, + Illuminate\Hashing\HashServiceProvider::class, + Illuminate\Mail\MailServiceProvider::class, + Illuminate\Notifications\NotificationServiceProvider::class, + Illuminate\Pagination\PaginationServiceProvider::class, + Illuminate\Pipeline\PipelineServiceProvider::class, + Illuminate\Queue\QueueServiceProvider::class, + Illuminate\Redis\RedisServiceProvider::class, + Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, + Illuminate\Session\SessionServiceProvider::class, + Illuminate\Translation\TranslationServiceProvider::class, + Illuminate\Validation\ValidationServiceProvider::class, + Illuminate\View\ViewServiceProvider::class, + + /* + * Package Service Providers... + */ + + /* + * Application Service Providers... + */ + App\Providers\AppServiceProvider::class, + App\Providers\AuthServiceProvider::class, + // App\Providers\BroadcastServiceProvider::class, + App\Providers\EventServiceProvider::class, + App\Providers\RouteServiceProvider::class, + + ], + + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | + */ + + 'aliases' => [ + + 'App' => Illuminate\Support\Facades\App::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, + 'Notification' => Illuminate\Support\Facades\Notification::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, + + ], ]; diff --git a/fail.log b/fail.log index 626636b..91ba664 100644 --- a/fail.log +++ b/fail.log @@ -2872,3 +2872,13 @@ /Users/shixuesen/OneDrive/Pictures/instagram/jeonjisu92/ https://scontent-lga3-1.cdninstagram.com/v/t51.2885-15/405764174_890448209467134_31053123427125547_n.jpg?stp=dst-jpg_e15&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi43MjB4OTAwLnNkciJ9&_nc_ht=scontent-lga3-1.cdninstagram.com&_nc_cat=106&_nc_ohc=InIzDP-xdjYAX_Bsyai&edm=ABmJApABAAAA&ccb=7-5&ig_cache_key=MzI0Nzk1ODEyMDQwNjUxNzk0Ng%3D%3D.2-ccb7-5&oh=00_AfBKGprbJ8llnyKnOQXKZhMnlhEVgtWa1NG6uuVPGd5s0g&oe=6572981E&_nc_sid=b41fef /Users/shixuesen/OneDrive/Pictures/instagram/sejinming/ https://scontent-lga3-1.cdninstagram.com/v/t51.2885-15/405249142_256728517096342_2023724632255599706_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE4MDAuc2RyIn0&_nc_ht=scontent-lga3-1.cdninstagram.com&_nc_cat=110&_nc_ohc=HhUmd22t5F8AX94_vPS&edm=ABmJApABAAAA&ccb=7-5&ig_cache_key=MzI0ODg5MDUyMDA3NDAyNTE1OA%3D%3D.2-ccb7-5&oh=00_AfB5l_gJqoMxd4ulTCO-vznxzTTKR7HhmciA54eIcaKt9g&oe=6572F42A&_nc_sid=b41fef /Users/shixuesen/OneDrive/Pictures/instagram/tanganqi88/ https://scontent-lga3-1.cdninstagram.com/v/t51.2885-15/405227498_1647607689356007_5245705880651592340_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE4MDAuc2RyIn0&_nc_ht=scontent-lga3-1.cdninstagram.com&_nc_cat=103&_nc_ohc=3M2xWWam0sEAX_GD2Eu&edm=ABmJApABAAAA&ccb=7-5&ig_cache_key=MzI0ODE5NDI5Njg4NTE3MTg1Ng%3D%3D.2-ccb7-5&oh=00_AfAIrqpKrFAc-QxOaQxywmgStiXUQkzD5AeCi3OsPmFFWw&oe=65743744&_nc_sid=b41fef +/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/ https://scontent-ord5-2.cdninstagram.com/v/t51.2885-15/409229163_909544967499556_5916553086414139985_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTkuc2RyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=104&_nc_ohc=lDw4cQTfmQgAX88WrZc&edm=AJ9x6zYBAAAA&ccb=7-5&ig_cache_key=MzI1NDc3NTQ3Njc0OTEyNzk4NQ%3D%3D.2-ccb7-5&oh=00_AfCq26o8G6B-cXFhkfdNaP8NvG7QlqKnep02m0niZoKvEQ&oe=657C0CAD&_nc_sid=65462d +/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/ https://scontent-ord5-2.cdninstagram.com/v/t51.2885-15/409811369_875174717443800_5655192729567967382_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTkuc2RyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=100&_nc_ohc=vmuv46n9otcAX8Xq9fD&edm=AJ9x6zYBAAAA&ccb=7-5&ig_cache_key=MzI1NjgyNDg1MzUxODc3NDE3NQ%3D%3D.2-ccb7-5&oh=00_AfCWmsH2YB-oMXG_W8k0kqLJ8XDwfcBAm3rW9f-_5Hq3_w&oe=6580412B&_nc_sid=65462d +/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/ https://scontent-ord5-1.cdninstagram.com/v/t51.2885-15/409568768_757426379541133_4532503370918559097_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE4MDAuc2RyIn0&_nc_ht=scontent-ord5-1.cdninstagram.com&_nc_cat=101&_nc_ohc=9rQqB10jCtIAX_-7BDb&edm=AJ9x6zYBAAAA&ccb=7-5&ig_cache_key=MzI1NjU2OTczMzgzMDM1MTUyMg%3D%3D.2-ccb7-5&oh=00_AfD2fiEG86FjhquLH5zuLAaOU9qU2uSitL2Tl-F6xTlfHA&oe=65804578&_nc_sid=65462d +/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/ https://scontent-ord5-2.cdninstagram.com/o1/v/t16/f1/m69/GH0h8hPvtsaVlw4DAHI-ELN14R0bbpR1AAAF.mp4?efg=eyJxZV9ncm91cHMiOiJbXCJpZ193ZWJfZGVsaXZlcnlfdnRzX290ZlwiXSIsInZlbmNvZGVfdGFnIjoidnRzX3ZvZF91cmxnZW4uY2xpcHMuYzIuMTA4MC5oaWdoIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=110&vs=682161550728818_4146122283&_nc_vs=HBksFQIYOnBhc3N0aHJvdWdoX2V2ZXJzdG9yZS9HSDBoOGhQdnRzYVZsdzREQUhJLUVMTjE0UjBiYnBSMUFBQUYVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3JlL0dHWVVUd2MyRVVVeVc0RUZBTUNvOWF5cXFLWUNicFIxQUFBRhUCAsgBACgAGAAbABUAACaguJK1mae2QRUCKAJDMywXQCu7ZFocrAgYEmRhc2hfaGlnaF8xMDgwcF92MREAdf4HAA%3D%3D&ccb=9-4&oh=00_AfDxpXsRb_AcTC2C-2nxfKD9_cdRMmKD39ra2NKy5zyJTg&oe=658182F5&_nc_sid=65462d +/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/ https://scontent-ord5-2.cdninstagram.com/v/t51.2885-15/411985076_1436185637277602_7201884976861277622_n.heic?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDEzMzQuc2RyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=102&_nc_ohc=7GFLH-FyXPQAX8VSzZY&edm=AJ9x6zYBAAAA&ccb=7-5&ig_cache_key=MzI2MDIwNDMwOTMxMjA5MzczMw%3D%3D.2-ccb7-5&oh=00_AfA0hcZJUcOvjaTxpdjBX8QrBZORdqxzIkSJgMPglJyQsA&oe=65870200&_nc_sid=65462d +/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/ https://scontent-ord5-2.cdninstagram.com/v/t51.2885-15/412143758_751934510141420_8878617995330096933_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE4MDAuc2RyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=1&_nc_ohc=pOhOnNWaqA8AX_m-WWR&edm=AJ9x6zYBAAAA&ccb=7-5&ig_cache_key=MzI2MjM1MTE1NTUyNzMzOTg3OQ%3D%3D.2-ccb7-5&oh=00_AfCGD_NjZT8uF4GO_FQQV138TIUG1GKwRaxXbhoAQ92cPA&oe=6587F393&_nc_sid=65462d +/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/ https://scontent-ord5-2.cdninstagram.com/v/t51.2885-15/412588485_350386820942940_5492361398849561178_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE3OTguc2RyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=100&_nc_ohc=bmAT5F7yDGIAX-WSVnr&edm=AJ9x6zYBAAAA&ccb=7-5&ig_cache_key=MzI2MjcxMjk3MjM1NDQyNjg2MA%3D%3D.2-ccb7-5&oh=00_AfCS_q6EUXPil6Wnli_kPr3ccqcDfHpl4LSakut7SfE9MQ&oe=6589DCD6&_nc_sid=65462d +/Users/shixuesen/OneDrive/Pictures/instagram/angelachong_99/ https://scontent-ord5-2.cdninstagram.com/v/t51.2885-15/412005451_375866248159219_7561385400859366692_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE2Njkuc2RyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=107&_nc_ohc=VoTQxJoiufQAX9YPt6w&edm=ABmJApABAAAA&ccb=7-5&ig_cache_key=MzI2MTc5MjM0MTAxMzI0NzIyNA%3D%3D.2-ccb7-5&oh=00_AfBl5SUZbYsvVwqipWZBEudfHUQmxNhKfmBWIlXrHLKpeQ&oe=658A53A0&_nc_sid=b41fef +/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/ https://scontent-ord5-2.cdninstagram.com/v/t51.2885-15/412047008_877424210543807_2872531690300169941_n.heic?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi43NTB4NzUwLnNkciJ9&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=111&_nc_ohc=VUxzuok2kIYAX_Kn0mh&edm=AJ9x6zYBAAAA&ccb=7-5&ig_cache_key=MzI2MjYwMDk3NjgyOTA0MDU1Nw%3D%3D.2-ccb7-5&oh=00_AfD3JRKkOAv4NjK7wjPYxaobIwvaqx8CHiqz1P1NDpkIbg&oe=6589E052&_nc_sid=65462d +/Users/shixuesen/OneDrive/Pictures/instagram/seojuhyun_s/ https://scontent-ord5-2.cdninstagram.com/v/t51.2885-15/412547758_664369592512983_4901457193184855548_n.jpg?stp=dst-jpg_e35&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xNDQweDE4MDAuc2RyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=1&_nc_ohc=_AnRN5AZtZ4AX_cVMiq&edm=ABmJApABAAAA&ccb=7-5&ig_cache_key=MzI2NDg2NTQ3Mzg2Mjc3NzQ0NA%3D%3D.2-ccb7-5&oh=00_AfA2lFy1j3dI8j9436z9Vw21qZANQ3vEyIPrbcqzhedDRg&oe=658D494E&_nc_sid=b41fef