/* Decoded by unphp.net */ sphost = $cf["javbushost"]; $this->hosturl = "https://{$this->sphost}/"; $start_type = "movie"; $cki = "__cfduid=abb34186a88cf87a8cf32e4dbbd6b06791472108187" . '' . "; existmag=all; appad=off; cnadd5=off; PHPSESSID=b83l3o7d0ps34e14f3xxxx" . rand(1000, 9999); $headers = array("Host" => $this->sphost, "Accept-Encoding" => "gzip, deflate", "Referer" => $this->hosturl, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0", "Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" => "zh-CN,zh;q=0.9,en;q=0.8", "Cookie" => $cki, "Connection" => "keep-alive", "Cache-Control" => "max-age=0"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $r = $this->prepare_movie_rquests("https://{$this->sphost}/AVOP-404", $movie404); if ($r) { $this->start_spider($moviemax); } } public function handle_movie($movieid) { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["javbushost"]; $this->hosturl = "https://{$this->sphost}/"; $start_type = "movie"; $cki = "__cfduid=abb34186a88cf87a8cf32e4dbbd6b06791472108187" . '' . "; existmag=all; appad=off; cnadd5=off; PHPSESSID=b83l3o7d0ps34e14f3xxxx" . rand(1000, 9999); $headers = array("Host" => $this->sphost, "Accept-Encoding" => "gzip, deflate", "Referer" => $this->hosturl, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0", "Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" => "zh-CN,zh;q=0.9,en;q=0.8", "Cookie" => $cki, "Connection" => "keep-alive", "Cache-Control" => "max-age=0"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $requrl = "https://{$this->sphost}/{$movieid}"; $response = $this->spclient->get($requrl); $code = $response->getStatusCode(); if ($code == 200) { $func_name = $this->func_get_info_name; $data = $this->{$func_name}($response); if (!empty($data)) { $this->database->insert($this->in_table_name, $data); $this->handle_magnet($data["gid"]); } else { } } else { echo "{$code}"; } } public function handle_page($gid) { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["javbushost"]; $this->hosturl = "https://{$this->sphost}/"; $start_type = "page"; $cki = "__cfduid=abb34186a88cf87a8cf32e4dbbd6b06791472108187" . '' . "; existmag=all; appad=off; cnadd5=off; PHPSESSID=b83l3o7d0ps34e14f3xxxx" . rand(1000, 9999); $headers = array("Host" => $this->sphost, "Accept-Encoding" => "gzip, deflate", "Referer" => $this->hosturl, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0", "Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" => "zh-CN,zh;q=0.9,en;q=0.8", "Cookie" => $cki, "Connection" => "keep-alive", "Cache-Control" => "max-age=0"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $r = $this->prepare_page_rquests("https://{$this->sphost}/page/1", 1); if ($r) { $this->start_spider(200); } } public function handle_all_page($pagenum = 10, $genre = '') { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["javbushost"]; $this->hosturl = "https://{$this->sphost}/"; $start_type = "page"; $cki = "__cfduid=abb34186a88cf87a8cf32e4dbbd6b06791472108187" . '' . "; existmag=mag; appad=off; cnadd5=off; PHPSESSID=b83l3o7d0ps34e14f3xxxx" . rand(1000, 9999); $headers = array("Host" => $this->sphost, "Accept-Encoding" => "gzip, deflate", "Referer" => $this->hosturl, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0", "Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" => "zh-CN,zh;q=0.9,en;q=0.8", "Cookie" => $cki, "Connection" => "keep-alive", "Cache-Control" => "max-age=0"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $r = $this->prepare_page_rquests("https://{$this->sphost}/page/1", $pagenum, $genre); if ($r) { $this->start_spider(intval($this->option("moviemax"))); } } public function handle_all_magnet($pagenum = 1) { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["javbushost"]; $this->hosturl = "https://{$this->sphost}/"; $start_type = "magnet"; $headers = array("accept" => " */*", "accept-encoding" => " gzip, deflate", "accept-language" => " zh-CN,zh;q=0.9,en;q=0.8", "cookie" => " __cfduid=d81cc88b23e9028e96a7163ab877395191555602526; starinfo=glyphicon%20glyphicon-plus; existisgenres=gr_single; existmag=mag; 4fJN_2132_saltkey=Gj4yHsTs; 4fJN_2132_lastvisit=1555681998; PHPSESSID=qm0du428o07jr3ujljfd3t1vb1", "referer" => " " . $this->hosturl . "/SGA-128", "user-agent" => " Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36", "x-requested-with" => " XMLHttpRequest"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $requrl = "{$this->hosturl}ajax/uncledatoolsbyajax.php?gid=39908097745&lang=zh&img=https://pics.javcdn.pw/cover/721a_b.jpg&uc=0&floor=695"; $r = $this->prepare_mag_rquests($requrl, $pagenum); if ($r) { $this->start_spider(intval($this->option("moviemax"))); } } public function handle_magnet($gid) { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["javbushost"]; $this->hosturl = "https://{$this->sphost}/"; $start_type = "magnet"; $headers = array("accept" => " */*", "accept-encoding" => " gzip, deflate", "accept-language" => " zh-CN,zh;q=0.9,en;q=0.8", "cookie" => " __cfduid=d81cc88b23e9028e96a7163ab877395191555602526; starinfo=glyphicon%20glyphicon-plus; existisgenres=gr_single; existmag=mag; 4fJN_2132_saltkey=Gj4yHsTs; 4fJN_2132_lastvisit=1555681998; PHPSESSID=qm0du428o07jr3ujljfd3t1vb1", "referer" => " " . $this->hosturl . "/SGA-128", "user-agent" => " Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36", "x-requested-with" => " XMLHttpRequest"); $requrl = "{$this->hosturl}ajax/uncledatoolsbyajax.php?gid={$gid}&lang=zh&img=https://pics.javcdn.pw/cover/721a_b.jpg&uc=0&floor=695"; $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $response = $this->spclient->get($requrl); $code = $response->getStatusCode(); if ($code == 200) { $func_name = $this->func_get_info_name; $data = $this->{$func_name}($response, $gid); if (!empty($data)) { $this->database->insert($this->in_table_name, $data); } else { } } else { echo "error {$code}"; } } public function handle() { if ($this->option("movieid")) { $this->handle_movie($this->option("movieid")); return; } if ($this->option("magnetid")) { $this->handle_magnet($this->option("magnetid")); return; } if ($this->option("movie") == 1) { $movie404 = $this->option("movie404") * 1; $moviemax = $this->option("moviemax") * 1; $this->handle_all_movie($moviemax, $movie404); } if ($this->option("page") * 1 > 0) { $this->handle_all_page($this->option("page") * 1, $this->option("genre")); } if ($this->option("magpage") !== null) { $this->handle_all_magnet($this->option("magpage") * 1); } } public function update_ja_code_36($table_javbus, $table_avmoo) { $sql = "UPDATE {$table_javbus} set avmoo_code_36 = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( REPLACE(movie_pic_cover,'cover/',''),'_b.jpg',''), 'https://pics.javbus.info/',''), 'https://pics.javcdn.pw/',''),\xa'https://images.javcdn.pw/',''),\xa'https://images.javbus.info/','') \xa\xa where avmoo_code_36 = '' and movie_pic_cover like '%https://%' "; $this->database->query($sql); $data = $this->database->query(" SELECT * from {$table_javbus} WHERE movie_pic_cover not like '%https://%' and avmoo_code_36 ='' ")->fetchAll(\PDO::FETCH_ASSOC); $arr = array(); foreach ($data as $key => $val) { $arr[] = $val["movie_pic_cover"]; } $d = $this->database->select($table_avmoo, array("code_36", "movie_pic_cover"), array("movie_pic_cover" => $arr)); foreach ($d as $key => $val) { $this->database->query("update {$table_javbus} set avmoo_code_36 = '{$val["code_36"]}' WHERE movie_pic_cover = '{$val["movie_pic_cover"]}' "); echo "update avmoo_code_36 :: {$key} == {$val["code_36"]} == {$val["movie_pic_cover"]} "; } $data = $this->database->query(" SELECT count(1) as avmoo_code_36_null_num from {$table_javbus} WHERE avmoo_code_36 ='' ")->fetchAll(\PDO::FETCH_ASSOC); echo "avmoo_code_36_null_num : {$data[0]["avmoo_code_36_null_num"]} "; } public $sp_uri = ''; public function check_hosturl($requrl) { $this->info("GET: {$requrl} before sql"); $response = $this->spclient->get($requrl); $code = $response->getStatusCode(); if ($code == 200 || $code == 404) { } else { $this->error(__METHOD__ . ":[{$requrl} |====\351\223\276\xe6\216\xa5\xe6\227\xa0\346\225\210]"); die; } $type = $response->getHeader("content-type"); $parsed = \GuzzleHttp\Psr7\parse_header($type); $this->spcharset = isset($parsed[0]["charset"]) ? $parsed[0]["charset"] : "UTF-8"; } public function prepare_page_rquests($requrl, $pagenum = 10, $genre = '') { $this->sp_uri = "https://" . $this->sphost . "/page/"; if (!empty($genre)) { $this->sp_uri = "https://" . $this->sphost . "/genre/" . $genre . "/"; } $this->magnet_time = time(); $this->check_hosturl($requrl); $this->arr_req_code_36 = array(); for ($i = 1; $i < $pagenum + 1; $i++) { $this->arr_req_code_36[] = $i; } $total = count($this->arr_req_code_36); $this->info("{$this->start_type} \345\x8d\x87\347\xba\xa7\346\x95\xb0\xe9\207\x8f\357\274\x9a {$total}"); $requests = function ($total) { foreach ($this->arr_req_code_36 as $key => $item) { $uri = $this->sp_uri . $item; echo "[\xe5\275\223\xe5\211\x8d({$key}) \346\200\xbb\346\225\xb0({$total})| =({$item})-|]"; (yield new Request("GET", $uri)); } }; $this->sprequests = $requests($total); return true; } public function prepare_movie_rquests($requrl, $remove404 = 0) { $this->info("GET: {$requrl} before sql"); $this->check_hosturl($requrl); $sql = "select DISTINCT(censored_id) from avbook_avmoo_movie "; $this->info($sql); $result_code_avmoo = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $sql = "select DISTINCT(censored_id) from avbook_javbus_movie"; $this->info($sql); $result_code_javbus = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $this->info("javbus \xe7\x94\265\xe5\xbd\261 \xe6\x95\xb0\xe9\207\217\xef\274\232" . count($result_code_javbus)); $sql = "SELECT censored_id,COUNT(censored_id) as c FROM `avbook_avmoo_movie` GROUP BY censored_id HAVING c>1 "; $this->info($sql); $result_more = $this->database->query($sql)->fetchAll(); $this->info("avmoo censored_id \xe9\207\x8d\345\244\x8d\xe7\224\265\xe5\xbd\xb1\346\225\260\351\x87\217\357\xbc\x9a" . count($result_more)); foreach ($result_more as $value) { for ($i = 0; $i < intval($value[1]); $i++) { $end = $i + 1; $result_code_avmoo[] = $value[0] . "-" . $end; } } $this->info("avmoo \xe7\x94\xb5\xe5\xbd\xb1 \xe6\225\260\351\207\217\xef\xbc\232" . count($result_code_avmoo)); $result_dif = array_diff($result_code_avmoo, $result_code_javbus); if ($remove404 == 1) { $sql = "select code_36 from avbook_crawler_404 where intable_name = '{$this->in_table_name}' and checkdata = 1"; $this->info($sql); $table_code_36_404 = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $result_dif = array_diff($result_dif, $table_code_36_404); } $this->arr_req_code_36 = array_values($result_dif); $total = count($this->arr_req_code_36); if ($total == 0) { $this->warn("{$this->start_type} \346\xb2\241\346\x9c\211\xe5\242\236\351\207\x8f\xe6\x9b\264\346\226\260"); return false; } $this->info("{$this->start_type} \xe5\x8d\207\xe7\xba\xa7\xe6\225\xb0\xe9\x87\x8f\357\274\232 {$total}"); $requests = function ($total) { foreach ($this->arr_req_code_36 as $key => $item) { $uri = "https://" . $this->sphost . "/" . $item; echo "[\345\275\x93\xe5\211\215({$key}) \346\x80\xbb\xe6\225\260({$total})| =({$item})-|]"; (yield new Request("GET", $uri)); } }; $this->sprequests = $requests($total); return true; } public function prepare_mag_rquests($requrl, $pagenum = 1) { $this->update_ja_code_36("avbook_javbus_movie", "avbook_avmoo_movie"); $this->check_hosturl($requrl); if ($pagenum == 0) { $sql = "select DISTINCT(gid) from {$this->table_prefix}movie "; $this->info($sql); $table_code_36 = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $this->arr_req_code_36 = array_values($table_code_36); } else { $slimit = " ORDER BY t1.magnet_date desc LIMIT " . $pagenum * 30; $sql = "SELECT t2.gid FROM avbook_avmoo_movie t1 LEFT JOIN avbook_javbus_movie t2 on t1.code_36 = t2.avmoo_code_36 {$slimit} "; $this->info($sql); $table_code_36 = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $this->arr_req_code_36 = array_values($table_code_36); } $total = count($this->arr_req_code_36); if ($total == 0) { $this->warn("{$this->start_type} \xe6\262\xa1\346\234\211\345\242\236\xe9\x87\x8f\346\233\xb4\xe6\x96\xb0"); return false; } $this->info("{$this->start_type} \xe5\215\207\xe7\272\247\346\225\xb0\xe9\x87\217\xef\xbc\232 {$total}"); $requests = function ($total) { foreach ($this->arr_req_code_36 as $key => $item) { $uri = "https://" . $this->sphost . "/ajax/uncledatoolsbyajax.php?gid=" . $item . "&lang=zh&img=https://pics.javcdn.pw/cover/72z3_b.jpg&uc=0&floor=601"; echo "[\xe5\xbd\223\xe5\x89\215({$key}) \346\x80\273\xe6\x95\xb0({$total})| =({$item})-|]"; (yield new Request("GET", $uri)); } }; $this->sprequests = $requests($total); return true; } public function get_info_en_star($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); if (strpos($content, "") === false) { echo "\351\241\xb5\351\235\xa2\344\270\x8d\xe5\xae\214\xe6\225\xb4"; return null; } $arr_data = array(); $s = "#hosturl . "star/(.*?)">English#"; preg_match($s, $content, $out); if (empty($out[1])) { return null; } else { $arr_data["code_36"] = $out[1]; $arr_data["code_10"] = base_convert($arr_data["code_36"], 36, 10); } preg_match("#(.*?)#", $content, $out); $arr_data["star_name"] = empty($out[1]) ? '' : $out[1]; preg_match("#"https://pics.javcdn.pw/actress/(.*?)"#", $content, $out); $arr_data["star_pic"] = empty($out[1]) ? '' : $out[1]; preg_match("#

D.O.B: (.*?)

#", $content, $out); $arr_data["star_birthday"] = empty($out[1]) ? '' : $out[1]; preg_match("#

Age: (.*?)

#", $content, $out); $arr_data["star_age"] = empty($out[1]) ? '' : $out[1]; preg_match("#

Cup: (.*?)

#", $content, $out); $arr_data["star_cupsize"] = empty($out[1]) ? '' : $out[1]; preg_match("#

Height: (.*?)cm

#", $content, $out); $arr_data["star_height"] = empty($out[1]) ? '' : $out[1]; preg_match("#

Bust: (.*?)cm

#", $content, $out); $arr_data["star_bust"] = empty($out[1]) ? '' : $out[1]; preg_match("#

Waist: (.*?)cm

#", $content, $out); $arr_data["star_waist"] = empty($out[1]) ? '' : $out[1]; preg_match("#

Hips: (.*?)cm

#", $content, $out); $arr_data["star_hip"] = empty($out[1]) ? '' : $out[1]; preg_match("#

Hometown: (.*?)

#", $content, $out); $arr_data["hometown"] = empty($out[1]) ? '' : $out[1]; preg_match("#

Hobby: (.*?)

#", $content, $out); $arr_data["hobby"] = empty($out[1]) ? '' : $out[1]; return $arr_data; } public function get_info_star($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); if (strpos($content, "") === false) { echo "\xe9\xa1\265\xe9\x9d\242\xe4\xb8\x8d\345\256\x8c\xe6\225\264"; return null; } $arr_data = array(); $s = "#hosturl . "star/(.*?)">\344\xb8\xad\xe6\226\x87#"; preg_match($s, $content, $out); if (empty($out[1])) { return null; } else { $arr_data["code_36"] = $out[1]; $arr_data["code_10"] = base_convert($arr_data["code_36"], 36, 10); } preg_match("#(.*?)#", $content, $out); $arr_data["star_name"] = empty($out[1]) ? '' : $out[1]; preg_match("#"https://pics.javcdn.pw/actress/(.*?)"#", $content, $out); $arr_data["star_pic"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\xe7\224\x9f\346\227\xa5: (.*?)

#", $content, $out); $arr_data["star_birthday"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\345\xb9\264\xe9\xbd\241: (.*?)

#", $content, $out); $arr_data["star_age"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\347\275\251\346\235\xaf: (.*?)

#", $content, $out); $arr_data["star_cupsize"] = empty($out[1]) ? '' : $out[1]; preg_match("#\350\xba\253\xe9\253\x98: (.*?)cm

#", $content, $out); $arr_data["star_height"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\350\203\270\xe5\x9c\215: (.*?)cm

#", $content, $out); $arr_data["star_bust"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\350\x85\xb0\xe5\234\215: (.*?)cm

#", $content, $out); $arr_data["star_waist"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\350\x87\x80\345\234\x8d: (.*?)cm

#", $content, $out); $arr_data["star_hip"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\345\207\272\347\224\x9f\345\x9c\260: (.*?)

#", $content, $out); $arr_data["hometown"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\346\x84\233\345\245\275: (.*?)

#", $content, $out); $arr_data["hobby"] = empty($out[1]) ? '' : $out[1]; return $arr_data; } public function get_info_series($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); if (strpos($content, "") === false) { echo "\351\241\265\351\x9d\xa2\344\270\215\xe5\xae\214\346\x95\264"; return null; } $arr_data = array(); $s = "#hosturl . "series/(.*?)">\344\270\xad\xe6\x96\x87#"; preg_match($s, $content, $out); if (empty($out[1])) { return null; } else { $arr_data["code_36"] = $out[1]; $arr_data["code_10"] = base_convert($arr_data["code_36"], 36, 10); } preg_match("#(.*?) - \347\xb3\xbb\345\210\227 - \345\275\261\347\x89\x87#", $content, $out); $arr_data["series_name"] = empty($out[1]) ? '' : $out[1]; return $arr_data; } public function get_info_studio($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); if (strpos($content, "") === false) { echo "\351\xa1\265\351\x9d\242\xe4\270\215\345\256\x8c\346\225\264"; return null; } $arr_data = array(); $s = "#hosturl . "studio/(.*?)">\xe4\xb8\xad\xe6\226\x87#"; preg_match($s, $content, $out); if (empty($out[1])) { return null; } else { $arr_data["code_36"] = $out[1]; $arr_data["code_10"] = base_convert($arr_data["code_36"], 36, 10); } preg_match("#(.*?) - \350\xa3\275\344\275\234\345\225\x86 - \345\xbd\261\347\211\x87#", $content, $out); $arr_data[$this->start_type . "_name"] = empty($out[1]) ? '' : $out[1]; return $arr_data; } public function get_info_director($response, $c_36 = '') { } public function get_info_magnet($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); $need_hd = "\345\x8c\205\xe5\x90\xab\xe9\xab\x98\xe6\xb8\205HD\347\232\204\347\xa3\x81\345\x8a\x9b\xe9\x80\xa3\347\265\220"; $need_sub = "\xe5\214\205\xe5\x90\xab\xe5\255\x97\345\271\x95\347\x9a\204\xe7\243\x81\345\212\233\xe9\x80\243\xe7\265\220"; $mg_arr = array(); preg_match_all("#[\s]*?(.*?)[\s]*?[\s\S]*?\xe3\200\x90\350\244\x87\xe8\xa3\xbd\351\x80\243\xe7\xb5\x90\347\266\262\xe5\x9d\200\xe3\200\221" href="magnet[\s\S]*?">[\s]*?(.*?)[\s]*?[\s\S]*?\343\x80\x90\350\xa4\207\xe8\xa3\xbd\351\x80\xa3\347\265\x90\xe7\266\xb2\xe5\235\x80\xe3\200\221" href="magnet[\s\S]*?xt=urn:btih:(.*?)&[\s\S]*?">[\s]*?(.*?)[\s]*?#", $content, $out); if (!empty($out[2])) { foreach ($out[2] as $key => $value) { $temp_arr = array(); $have_hd = 0; $have_sub = 0; if (strpos($value, $need_hd)) { $have_hd = 1; $value = str_replace("\351\253\230\346\xb8\205", '', $value); } if (strpos($value, $need_sub)) { $have_sub = 1; $value = str_replace("\345\255\x97\345\xb9\x95", '', $value); } $temp_arr["gid"] = $c_36; $xt = trim($out[4][$key]); $temp_arr["magnet_xt"] = $xt; $temp_arr["magnet_name"] = trim($value); $temp_arr["magnet_type"] = trim($out[3][$key]); $temp_arr["magnet_date"] = trim($out[5][$key]); $temp_arr["have_hd"] = $have_hd; $temp_arr["have_sub"] = $have_sub; $mg_arr[] = $temp_arr; } } return $mg_arr; } public $magnet_time = 1; public function get_info_page($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); $dom = new \DOMDocument(); @$dom->loadHTML($content); $dom->normalize(); $xpath = new \DOMXPath($dom); $nodeList = $xpath->query("//*[@class="photo-info"]"); $need_hd = "\345\x8c\x85\xe5\220\xab\xe9\253\x98\346\xb8\x85HD\xe7\x9a\204\xe7\xa3\x81\345\x8a\x9b\351\200\xa3\347\xb5\220"; $need_sub = "\xe5\214\205\345\x90\xab\345\255\227\345\xb9\225\xe7\232\204\xe7\243\201\345\x8a\x9b\351\x80\243\xe7\xb5\x90"; $t_i = 0; foreach ($nodeList as $node) { $str_node = $dom->saveHTML($node); preg_match_all("#(.*?)#", $str_node, $outid); if (!empty($outid[1][0])) { $sadd = ''; if (strpos($str_node, $need_hd)) { $sadd .= ",have_hd=1"; } if (strpos($str_node, $need_sub)) { $sadd .= ",have_sub=1"; } $t_i = $t_i + 1; $m_time = $this->magnet_time - $c_36 * 30 - $t_i; $t = date("Y-m-d H:i:s", $m_time); $ssql = " update avbook_avmoo_movie set magnet_date = '{$t}', have_mg = 1 {$sadd} where censored_id ='{$outid[1][0]}'"; $this->database->query($ssql); } } } public function get_info_movie($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); $arr_data = array(); preg_match("#var gid = (.*?);#", $content, $out); $arr_data["gid"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\xe8\xad\x98\xe5\210\245\xe7\xa2\274: (.*?)#", $content, $out); $arr_data["censored_id"] = empty($out[1]) ? '' : $out[1]; $censored_id = $out[1]; if (empty($out[1])) { return null; } preg_match("#

(.*?)

#", $content, $out); $arr_data["movie_title"] = empty($out[1]) ? '' : trim(str_replace($censored_id, '', $out[1])); preg_match("#\347\231\xbc\350\xa1\214\xe6\x97\xa5\xe6\x9c\237: (.*?)

#", $content, $out); $arr_data["release_date"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\xe9\225\267\xe5\xba\xa6: (.*?)

#", $content, $out); $arr_data["movie_length"] = empty($out[1]) ? '' : str_replace("\xe5\210\206\351\220\230", '', $out[1]); preg_match("#

\345\xb0\216\346\xbc\x94: hosturl . "director/(.*?)">#", $content, $out); $arr_data["Director"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\350\xa3\275\xe4\275\x9c\345\x95\206: hosturl . "studio/(.*?)">#", $content, $out); $arr_data["Studio"] = empty($out[1]) ? '' : $out[1]; preg_match("#

\347\x99\274\350\241\x8c\xe5\225\206: hosturl . "label/(.*?)">#", $content, $out); $arr_data["Label"] = empty($out[1]) ? '' : $out[1]; preg_match_all("#

\347\xb3\273\345\x88\x97: hosturl . "series/(.*?)">#", $content, $out); $arr_data["Series"] = empty($out[1]) ? '' : implode(",", $out[1]); preg_match_all("#hosturl . "genre/(.*?)">#", $content, $out); $arr_data["Genre"] = empty($out[1]) ? '' : "[" . implode("][", $out[1]) . "]"; preg_match_all("#hosturl . "star/(.*?)">

#", $content, $out); if (empty($out[1])) { preg_match_all("#
hosturl . "(.*?)" style="display:inline-block; margin:5px;">#", $content, $out); $arr_data["Similar"] = empty($out[1]) ? '' : "[" . implode("][", $out[1]) . "]"; return $arr_data; } } ?>