Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace App\Console\Commands; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Pool; u..

Decoded Output download

<?php
 namespace App\Console\Commands; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Pool; use GuzzleHttp\Client; class JavlibraryCrawler extends BaseCrawler { protected $signature = "avbook:javlib {--genre} {--movie} {--maxpage=0}  "; protected $description = "javlib.com Crawler "; public function __construct() { parent::__construct(); } public function handle() { if ($this->option("genre")) { $this->handle_genre(); } if ($this->option("movie")) { $this->handle_movie(); } } public $max_concurrency = 16; public function handle_genre() { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["javlibhost"]; $this->hosturl = "http://{$this->sphost}/"; $start_type = "gern"; $headers = array("Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "Accept-Encoding" => "gzip, deflate", "Accept-Language" => "zh-CN,zh;q=0.9,en;q=0.8", "Cache-Control" => "max-age=0", "Connection" => "keep-alive", "Cookie" => "__cfduid=de58b540550437dded9edf806e15e97921558631740; timezone=-480; over18=18; __qca=P0-1061630505-1558631744517; Hm_lvt_bfc6c23974fbad0bbfed25f88a973fb0=1558632657; Hm_lpvt_bfc6c23974fbad0bbfed25f88a973fb0=1558632681", "Host" => $this->sphost, "Upgrade-Insecure-Requests" => "1", "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $client = new \GuzzleHttp\Client(array("headers" => $headers, "http_errors" => false)); $response = $client->get($this->hosturl . "cn/genres.php"); $type = $response->getHeader("content-type"); $parsed = \GuzzleHttp\Psr7\parse_header($type); $original_body = (string) $response->getBody(); $this->spcharset = isset($parsed[0]["charset"]) ? $parsed[0]["charset"] : "UTF-8"; $html = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); preg_match_all("#vl_genre.php\?g=(.*?)">(.*?)</a>#", $html, $out); $data = array(); $this->arr_req_rejected = array(); foreach ($out[1] as $key => $value) { $value = trim($value); if (!empty($value)) { $this->arr_req_rejected[] = $value; $temp_arr = array(); $temp_arr["genre_code"] = $value; $temp_arr["genre_dsce"] = $out[2][$key]; $temp_arr["code_10"] = base_convert($value, 36, 10); array_push($data, $temp_arr); } } $this->database->insert("avbook_javlib_genre", $data); while (1) { if (!empty($this->arr_req_rejected)) { $this->arr_req_code_36 = $this->arr_req_rejected; $this->arr_req_rejected = array(); } else { break; } $total = count($this->arr_req_code_36); $requests = function ($total) { foreach ($this->arr_req_code_36 as $key => $item) { $uri = "http://" . $this->sphost . "/cn/vl_genre.php?list&mode=2&page=1&g=" . $item; echo "[\xe5\xbd\223\xe5\211\x8d({$key}) \xe6\200\273\346\225\260({$total})| =({$item})-|]"; (yield new Request("GET", $uri, array("verify" => false))); } }; $this->sprequests = $requests($total); $pool = new Pool($this->spclient, $this->sprequests, array("concurrency" => $this->max_concurrency, "options" => array("timeout" => 6), "fulfilled" => function ($response, $index) { echo "[get res:{$index}]"; $c36 = isset($this->arr_req_code_36[$index]) ? $this->arr_req_code_36[$index] : "2"; $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); if (strpos($content, "</html>") === false) { $this->arr_req_rejected[] = $c36; $this->warn("{$c36} \351\xa1\xb5\xe9\235\242\xe4\270\215\345\xae\x8c\xe6\x95\264"); return; } preg_match("#<a class="page last" href=".*?&page=(.*?)"#", $content, $out); $pnum = !empty($out[1]) ? $out[1] : "1"; $sql = "update  `avbook_javlib_genre` set  old_page_num = page_num, page_num = {$pnum}   where genre_code = '{$c36}' "; echo "{$sql} 
"; $this->database->query($sql); }, "rejected" => function ($reason, $index) { $c36 = isset($this->arr_req_code_36[$index]) ? $this->arr_req_code_36[$index] : "1"; $this->arr_req_rejected[] = $c36; $this->error("[{$index} = {$c36} = rejected]"); })); $promise = $pool->promise(); $promise->wait(); echo "======================================="; } $this->arr_requrl = array(); $sql = "SELECT  * from avbook_javlib_genre "; $table_genre = $this->database->query($sql)->fetchAll(\PDO::FETCH_ASSOC); $mpage = intval($this->option("maxpage")); foreach ($table_genre as $gen) { if ($mpage > 0) { $pnum = $gen["page_num"] - $gen["old_page_num"] + 1; echo "{$pnum} \xa"; if ($pnum < $mpage) { $pnum = $gen["page_num"] > $mpage ? $mpage : $gen["page_num"]; } } else { $pnum = $gen["page_num"]; } while ($pnum > 0) { $uri = $pnum . "&g=" . $gen["genre_code"]; $this->arr_requrl[] = $uri; $pnum = $pnum - 1; } } $this->arr_req_rejected = $this->arr_requrl; while (1) { if (!empty($this->arr_req_rejected)) { $this->arr_requrl = $this->arr_req_rejected; $this->arr_req_rejected = array(); } else { break; } $total = count($this->arr_requrl); $requests = function ($total) { foreach ($this->arr_requrl as $key => $item) { $uri = "http://" . $this->sphost . "/cn/vl_genre.php?list&mode=2&page=" . $item; echo "[\xe5\xbd\x93\xe5\211\x8d({$key}) \xe6\200\273\xe6\x95\260({$total})| =({$item})-|] \xa"; (yield new Request("GET", $uri)); } }; $this->sprequests = $requests($total); $pool = new Pool($this->spclient, $this->sprequests, array("concurrency" => $this->max_concurrency, "options" => array("timeout" => 18), "fulfilled" => function ($response, $index) { $code = $response->getStatusCode(); $c36 = $this->arr_requrl[$index]; echo "[ code {$code}  {$index} = {$c36}]"; if ($code == 200) { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); if (strpos($content, "</html>") === false) { $this->arr_req_rejected[] = $c36; $this->warn("{$c36} \xe9\241\xb5\xe9\x9d\242\344\270\215\345\xae\x8c\346\x95\xb4"); } preg_match_all("#<div class="video" id="vid_(.*?)">#", $content, $out); $data = array(); foreach ($out[1] as $key => $value) { $temp_arr = array(); $temp_arr["vid"] = trim($value); if (!empty($temp_arr["vid"])) { $data[] = $temp_arr; } } $this->database->insert("avbook_javlib_vid", $data); } else { $this->arr_req_rejected[] = $c36; } }, "rejected" => function ($reason, $index) { $c36 = isset($this->arr_requrl[$index]) ? $this->arr_requrl[$index] : "2"; $this->arr_req_rejected[] = $c36; $this->error("[{$index} = {$c36} = rejected]"); })); $promise = $pool->promise(); $promise->wait(); echo "======================================="; } } public $arr_requrl; public $arr_req_rejected; public function handle_movie($moviemax = 128) { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["javlibhost"]; $this->hosturl = "http://{$this->sphost}/"; $start_type = "movie"; $headers = array("Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "Accept-Encoding" => "gzip, deflate", "Accept-Language" => "zh-CN,zh;q=0.9,en;q=0.8", "Cache-Control" => "max-age=0", "Connection" => "keep-alive", "Cookie" => "__cfduid=de58b540550437dded9edf806e15e97921558631740; timezone=-480; over18=18; __qca=P0-1061630505-1558631744517; Hm_lvt_bfc6c23974fbad0bbfed25f88a973fb0=1558632657; Hm_lpvt_bfc6c23974fbad0bbfed25f88a973fb0=1558632681", "Host" => $this->sphost, "Upgrade-Insecure-Requests" => "1", "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $sql = "select vid from avbook_javlib_vid "; $this->info($sql); $table_vid = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $this->info(count($table_vid)); $sql = "select code_36 from avbook_javlib_movie "; $this->info($sql); $table_code_36 = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $this->info(count($table_code_36)); $this->arr_req_rejected = array_diff($table_vid, $table_code_36); while (1) { if (!empty($this->arr_req_rejected)) { $this->arr_req_code_36 = array_values($this->arr_req_rejected); $this->arr_req_rejected = array(); } else { break; } $total = count($this->arr_req_code_36); if ($total == 1 && $this->arr_req_code_36[0] == '') { $this->info(" \xe6\225\260\351\x87\x8f\xef\274\x9a {$total}"); break; } $this->info("{$this->start_type} \345\215\207\347\272\247\xe6\225\260\351\x87\217\357\xbc\x9a {$total}"); $requests = function ($total) { foreach ($this->arr_req_code_36 as $key => $item) { $uri = "http://" . $this->sphost . "/cn/?v=" . $item; echo "[\345\275\x93\345\211\215({$key}) \346\x80\273\xe6\x95\xb0({$total})| =({$item})-|]"; (yield new Request("GET", $uri)); } }; $this->sprequests = $requests($total); $pool = new Pool($this->spclient, $this->sprequests, array("concurrency" => 64, "options" => array("timeout" => 18), "fulfilled" => function ($response, $index) { $code = $response->getStatusCode(); $c36 = $this->arr_req_code_36[$index]; if ($code == 200) { echo "[get res:{$index}  {$c36} ]
"; $d = $this->get_info_movie($response, $c36); if (empty($d)) { if (!empty($c36)) { $this->arr_req_rejected[] = $c36; } } else { $this->database->insert("avbook_javlib_movie", $d); } } else { $this->arr_req_rejected[] = $c36; } }, "rejected" => function ($reason, $index) { $c36 = isset($this->arr_req_code_36[$index]) ? $this->arr_req_code_36[$index] : "2"; $this->arr_req_rejected[] = $c36; $this->error("[{$index} = {$c36} = rejected]"); })); $promise = $pool->promise(); $promise->wait(); echo "======================================="; } } public function get_info_movie($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "UTF-8", $this->spcharset); if (strpos($content, "</html>") === false) { echo "\xe9\xa1\xb5\xe9\x9d\242\344\270\215\xe5\xae\x8c\xe6\225\264"; return null; } $arr_data = array(); $arr_data["code_36"] = $c_36; $arr_data["code_10"] = base_convert($c_36, 36, 10); $code_36 = $c_36; preg_match("#<td class="header">\350\257\x86\xe5\210\xab\347\240\201:</td>[\s]*?<td class="text">(.*?)</td>#", $content, $out); $censored_id = empty($out[1]) ? '' : $out[1]; $arr_data["censored_id"] = $censored_id; preg_match("#<title>(.*?) - JAVLibrary</title>#", $content, $out); $arr_data["movie_title"] = empty($out[1]) ? '' : trim(str_replace($censored_id, '', $out[1])); preg_match("#id="video_jacket_img" src="(.*?)"#", $content, $out); $arr_data["movie_pic_cover"] = empty($out[1]) ? '' : str_replace(array("http://pics.dmm.co.jp/mono/movie/adult/", "//pics.dmm.co.jp/mono/movie/adult/"), '', $out[1]); preg_match("#<td class="header">\xe5\x8f\221\350\xa1\x8c\346\x97\245\xe6\x9c\x9f:</td>[\s]*?<td class="text">(.*?)</td>#", $content, $out); $arr_data["release_date"] = empty($out[1]) ? '' : $out[1]; preg_match("#<td class="header">\351\x95\277\xe5\xba\xa6:</td>[\s]*?<td><span class="text">(.*?)</span> \xe5\210\206\xe9\x92\x9f</td>#", $content, $out); $arr_data["movie_length"] = empty($out[1]) ? '' : $out[1]; preg_match("#href="vl_director.php\?d=(.*?)"#", $content, $out); $arr_data["Director"] = empty($out[1]) ? '' : $out[1]; preg_match("#href="vl_maker.php\?m=(.*?)"#", $content, $out); $arr_data["Studio"] = empty($out[1]) ? '' : $out[1]; preg_match("#href="vl_label.php\?l=(.*?)"#", $content, $out); $arr_data["Label"] = empty($out[1]) ? '' : $out[1]; preg_match("#<span class="score">\((.*?)\)</span>#", $content, $out); $arr_data["score"] = empty($out[1]) ? '' : floatval($out[1]); preg_match_all("#href="vl_genre.php\?g=(.*?)"#", $content, $out); $arr_data["Genre"] = empty($out[1]) ? '' : "[" . implode("][", $out[1]) . "]"; preg_match_all("#href="vl_star.php\?s=(.*?)"#", $content, $out); $arr_data["JAV_Idols"] = empty($out[1]) ? '' : "[" . implode("][", $out[1]) . "]"; $s = "<a href="userswanted.php\?v=" . $code_36 . "">(.*?)</a>"; preg_match("#{$s}#", $content, $out); $arr_data["userswanted"] = empty($out[1]) ? '' : $out[1]; preg_match("#href="userswatched.php\?v=" . $code_36 . "">(.*?)</a>#", $content, $out); $arr_data["userswatched"] = empty($out[1]) ? '' : $out[1]; preg_match("#href="usersowned.php\?v=" . $code_36 . "">(.*?)</a>#", $content, $out); $arr_data["usersowned"] = empty($out[1]) ? '' : $out[1]; $arr_data["comments"] = strpos($content, "<em>\347\251\272\xe7\x9a\x84\xe5\x88\x97\350\241\250</em>") === false ? 1 : 0; return $arr_data; } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace App\Console\Commands; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Pool; use GuzzleHttp\Client; class JavlibraryCrawler extends BaseCrawler { protected $signature = "\x61\x76\142\157\157\x6b\72\152\141\x76\154\x69\142\x20\173\x2d\x2d\x67\145\x6e\162\145\x7d\x20\173\55\55\x6d\x6f\x76\x69\x65\x7d\40\x7b\x2d\55\155\x61\170\x70\x61\147\x65\75\60\x7d\x20\40"; protected $description = "\x6a\141\x76\x6c\151\142\x2e\x63\x6f\155\40\x43\162\141\167\154\145\x72\x20"; public function __construct() { parent::__construct(); } public function handle() { if ($this->option("\x67\x65\156\x72\x65")) { $this->handle_genre(); } if ($this->option("\x6d\x6f\x76\x69\x65")) { $this->handle_movie(); } } public $max_concurrency = 16; public function handle_genre() { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["\x6a\x61\166\154\x69\x62\150\x6f\163\x74"]; $this->hosturl = "\x68\x74\164\x70\x3a\x2f\57{$this->sphost}\x2f"; $start_type = "\x67\x65\x72\156"; $headers = array("\x41\143\x63\x65\x70\164" => "\x74\x65\170\164\x2f\x68\164\x6d\154\x2c\x61\160\x70\154\x69\x63\x61\x74\151\x6f\156\x2f\170\150\x74\155\x6c\53\170\155\154\54\x61\x70\x70\x6c\x69\143\x61\164\151\x6f\156\57\x78\x6d\x6c\x3b\x71\x3d\60\56\71\x2c\x69\155\141\147\x65\57\167\x65\142\x70\54\151\155\141\x67\145\x2f\x61\160\x6e\x67\54\52\57\x2a\73\x71\x3d\x30\x2e\70", "\x41\x63\x63\x65\x70\164\55\105\x6e\143\x6f\144\151\156\x67" => "\147\172\151\x70\54\40\x64\145\146\154\x61\x74\x65", "\101\x63\143\x65\160\x74\55\114\x61\156\x67\x75\x61\147\145" => "\x7a\150\x2d\103\x4e\54\172\150\x3b\161\75\x30\56\71\x2c\145\x6e\x3b\x71\75\60\x2e\x38", "\x43\x61\143\150\x65\x2d\103\157\156\164\x72\157\154" => "\155\141\x78\x2d\x61\x67\145\75\x30", "\103\157\x6e\x6e\145\x63\164\151\157\156" => "\x6b\x65\145\160\55\141\154\151\166\x65", "\103\157\x6f\x6b\151\x65" => "\x5f\x5f\x63\146\144\165\x69\x64\75\x64\145\65\x38\142\65\x34\60\65\65\60\x34\63\67\144\x64\145\144\x39\145\x64\x66\70\x30\66\x65\61\65\x65\x39\67\71\62\x31\x35\x35\x38\x36\x33\61\x37\64\x30\73\x20\x74\x69\x6d\x65\172\x6f\156\145\x3d\x2d\64\x38\x30\x3b\40\157\166\145\162\x31\70\75\61\70\73\40\137\x5f\161\143\x61\75\120\x30\x2d\x31\60\66\x31\66\x33\x30\65\x30\x35\55\x31\65\65\x38\x36\63\61\67\64\64\x35\x31\x37\73\x20\110\155\x5f\x6c\166\164\137\142\x66\143\x36\x63\x32\63\x39\67\x34\146\142\x61\x64\x30\x62\x62\146\x65\144\x32\x35\146\x38\70\141\71\67\x33\146\x62\x30\75\61\65\x35\x38\66\63\x32\x36\65\x37\x3b\x20\110\x6d\137\154\160\x76\164\137\x62\146\x63\x36\x63\62\63\71\67\64\146\x62\141\144\60\x62\x62\x66\145\144\62\x35\x66\x38\x38\141\71\67\63\146\x62\x30\75\61\65\x35\x38\x36\x33\x32\x36\70\x31", "\x48\x6f\x73\164" => $this->sphost, "\x55\x70\147\162\141\144\x65\55\x49\x6e\x73\x65\143\165\x72\145\55\x52\145\161\x75\145\x73\x74\x73" => "\61", "\125\163\x65\x72\x2d\x41\x67\x65\x6e\164" => "\x4d\157\x7a\x69\154\154\x61\57\x35\x2e\60\x20\50\127\x69\156\144\x6f\167\x73\40\x4e\x54\40\x31\x30\x2e\60\x3b\x20\127\117\x57\66\64\51\x20\101\x70\x70\154\145\x57\145\142\113\x69\x74\57\x35\63\67\x2e\x33\66\40\x28\x4b\x48\124\115\114\x2c\40\154\x69\153\x65\40\x47\x65\x63\153\157\51\40\x43\x68\162\157\155\x65\57\67\x32\56\60\56\x33\x36\x32\66\56\x38\x31\40\x53\141\146\141\162\151\x2f\65\63\x37\x2e\x33\66"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $client = new \GuzzleHttp\Client(array("\150\x65\x61\x64\x65\162\x73" => $headers, "\x68\164\x74\x70\x5f\145\162\x72\x6f\162\163" => false)); $response = $client->get($this->hosturl . "\x63\x6e\57\147\x65\156\x72\x65\x73\x2e\160\x68\x70"); $type = $response->getHeader("\143\157\156\x74\x65\x6e\x74\55\x74\x79\160\145"); $parsed = \GuzzleHttp\Psr7\parse_header($type); $original_body = (string) $response->getBody(); $this->spcharset = isset($parsed[0]["\x63\x68\141\162\x73\145\x74"]) ? $parsed[0]["\143\x68\x61\162\x73\x65\x74"] : "\125\x54\106\55\x38"; $html = mb_convert_encoding($original_body, "\x55\x54\x46\55\x38", $this->spcharset); preg_match_all("\x23\166\x6c\x5f\x67\x65\x6e\x72\x65\56\x70\x68\x70\x5c\77\147\x3d\x28\x2e\52\x3f\51\42\x3e\50\x2e\x2a\x3f\51\74\x2f\141\76\x23", $html, $out); $data = array(); $this->arr_req_rejected = array(); foreach ($out[1] as $key => $value) { $value = trim($value); if (!empty($value)) { $this->arr_req_rejected[] = $value; $temp_arr = array(); $temp_arr["\147\x65\x6e\x72\x65\137\143\157\144\145"] = $value; $temp_arr["\147\x65\x6e\x72\x65\137\144\163\143\145"] = $out[2][$key]; $temp_arr["\143\157\144\145\137\61\x30"] = base_convert($value, 36, 10); array_push($data, $temp_arr); } } $this->database->insert("\x61\166\142\x6f\157\x6b\137\x6a\x61\x76\x6c\151\x62\137\x67\145\x6e\162\x65", $data); while (1) { if (!empty($this->arr_req_rejected)) { $this->arr_req_code_36 = $this->arr_req_rejected; $this->arr_req_rejected = array(); } else { break; } $total = count($this->arr_req_code_36); $requests = function ($total) { foreach ($this->arr_req_code_36 as $key => $item) { $uri = "\150\x74\x74\x70\72\x2f\x2f" . $this->sphost . "\x2f\x63\x6e\x2f\166\x6c\x5f\x67\x65\x6e\162\145\x2e\160\x68\160\77\x6c\151\x73\164\x26\x6d\157\x64\x65\x3d\62\46\160\x61\x67\145\x3d\x31\46\147\x3d" . $item; echo "\133\xe5\xbd\223\xe5\211\x8d\50{$key}\51\x20\xe6\200\273\346\225\260\50{$total}\x29\x7c\x20\75\x28{$item}\x29\x2d\174\x5d"; (yield new Request("\x47\105\124", $uri, array("\x76\145\162\151\x66\171" => false))); } }; $this->sprequests = $requests($total); $pool = new Pool($this->spclient, $this->sprequests, array("\x63\x6f\x6e\x63\165\162\x72\145\x6e\143\x79" => $this->max_concurrency, "\x6f\x70\x74\151\x6f\x6e\x73" => array("\164\x69\155\145\157\165\x74" => 6), "\x66\165\154\x66\x69\x6c\154\145\144" => function ($response, $index) { echo "\x5b\147\x65\164\x20\162\x65\163\72{$index}\x5d"; $c36 = isset($this->arr_req_code_36[$index]) ? $this->arr_req_code_36[$index] : "\62"; $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "\x55\124\106\x2d\70", $this->spcharset); if (strpos($content, "\74\x2f\150\164\155\154\x3e") === false) { $this->arr_req_rejected[] = $c36; $this->warn("{$c36}\40\351\xa1\xb5\xe9\235\242\xe4\270\215\345\xae\x8c\xe6\x95\264"); return; } preg_match("\x23\x3c\141\x20\143\154\x61\163\163\75\x22\160\x61\x67\x65\40\x6c\x61\163\164\42\40\150\162\x65\146\75\42\x2e\x2a\77\x26\160\x61\x67\145\75\50\x2e\52\77\x29\42\x23", $content, $out); $pnum = !empty($out[1]) ? $out[1] : "\x31"; $sql = "\165\x70\x64\x61\164\145\40\x20\x60\141\x76\142\x6f\157\153\x5f\152\141\x76\154\151\x62\x5f\147\145\156\x72\145\140\40\163\145\164\x20\x20\157\x6c\x64\137\x70\141\x67\x65\x5f\156\165\x6d\40\75\x20\x70\141\147\x65\137\156\165\155\x2c\40\160\x61\x67\145\x5f\156\165\155\40\x3d\40{$pnum}\x20\x20\x20\167\x68\145\x72\x65\x20\x67\145\x6e\162\145\137\143\157\x64\x65\x20\x3d\x20\x27{$c36}\47\40"; echo "{$sql}\x20\12"; $this->database->query($sql); }, "\x72\x65\x6a\145\143\x74\x65\144" => function ($reason, $index) { $c36 = isset($this->arr_req_code_36[$index]) ? $this->arr_req_code_36[$index] : "\x31"; $this->arr_req_rejected[] = $c36; $this->error("\133{$index}\x20\x3d\x20{$c36}\x20\75\40\162\x65\x6a\145\143\164\x65\x64\x5d"); })); $promise = $pool->promise(); $promise->wait(); echo "\x3d\75\75\75\75\x3d\x3d\x3d\x3d\x3d\x3d\75\75\75\x3d\75\x3d\x3d\x3d\x3d\x3d\75\x3d\x3d\75\x3d\x3d\x3d\x3d\75\75\75\x3d\x3d\x3d\75\75\x3d\75"; } $this->arr_requrl = array(); $sql = "\123\105\114\105\103\124\40\40\52\x20\146\x72\157\x6d\40\x61\166\142\157\x6f\153\x5f\152\x61\x76\154\151\142\137\x67\145\156\x72\x65\40"; $table_genre = $this->database->query($sql)->fetchAll(\PDO::FETCH_ASSOC); $mpage = intval($this->option("\155\x61\x78\x70\x61\x67\x65")); foreach ($table_genre as $gen) { if ($mpage > 0) { $pnum = $gen["\x70\x61\147\x65\x5f\x6e\165\x6d"] - $gen["\157\x6c\144\x5f\160\141\147\x65\137\156\165\155"] + 1; echo "{$pnum}\x20\xa"; if ($pnum < $mpage) { $pnum = $gen["\x70\x61\147\x65\137\156\x75\155"] > $mpage ? $mpage : $gen["\160\x61\x67\145\x5f\156\165\155"]; } } else { $pnum = $gen["\x70\141\147\145\x5f\x6e\x75\155"]; } while ($pnum > 0) { $uri = $pnum . "\x26\x67\x3d" . $gen["\x67\145\156\162\x65\x5f\x63\x6f\x64\145"]; $this->arr_requrl[] = $uri; $pnum = $pnum - 1; } } $this->arr_req_rejected = $this->arr_requrl; while (1) { if (!empty($this->arr_req_rejected)) { $this->arr_requrl = $this->arr_req_rejected; $this->arr_req_rejected = array(); } else { break; } $total = count($this->arr_requrl); $requests = function ($total) { foreach ($this->arr_requrl as $key => $item) { $uri = "\x68\164\164\x70\72\x2f\x2f" . $this->sphost . "\x2f\x63\x6e\x2f\166\x6c\x5f\x67\145\x6e\x72\145\x2e\x70\x68\x70\x3f\x6c\151\x73\x74\46\x6d\157\144\145\75\62\46\x70\x61\147\145\75" . $item; echo "\x5b\xe5\xbd\x93\xe5\211\x8d\x28{$key}\x29\40\xe6\200\273\xe6\x95\260\50{$total}\x29\174\x20\75\x28{$item}\51\55\174\135\x20\xa"; (yield new Request("\x47\105\124", $uri)); } }; $this->sprequests = $requests($total); $pool = new Pool($this->spclient, $this->sprequests, array("\x63\x6f\156\143\x75\x72\x72\x65\x6e\x63\x79" => $this->max_concurrency, "\x6f\160\164\151\157\x6e\x73" => array("\164\x69\155\145\x6f\165\164" => 18), "\x66\x75\154\146\x69\x6c\x6c\145\x64" => function ($response, $index) { $code = $response->getStatusCode(); $c36 = $this->arr_requrl[$index]; echo "\x5b\x20\143\157\x64\145\40{$code}\x20\40{$index}\x20\x3d\40{$c36}\135"; if ($code == 200) { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "\125\x54\106\x2d\x38", $this->spcharset); if (strpos($content, "\x3c\x2f\x68\164\x6d\154\76") === false) { $this->arr_req_rejected[] = $c36; $this->warn("{$c36}\40\xe9\241\xb5\xe9\x9d\242\344\270\215\345\xae\x8c\346\x95\xb4"); } preg_match_all("\43\x3c\x64\x69\166\x20\x63\x6c\x61\163\x73\75\x22\x76\x69\x64\x65\157\42\x20\151\144\75\x22\166\x69\144\137\x28\x2e\x2a\77\x29\42\x3e\x23", $content, $out); $data = array(); foreach ($out[1] as $key => $value) { $temp_arr = array(); $temp_arr["\x76\151\x64"] = trim($value); if (!empty($temp_arr["\166\151\144"])) { $data[] = $temp_arr; } } $this->database->insert("\141\166\x62\157\157\153\x5f\152\141\x76\x6c\x69\x62\x5f\166\x69\144", $data); } else { $this->arr_req_rejected[] = $c36; } }, "\162\145\152\145\143\164\145\144" => function ($reason, $index) { $c36 = isset($this->arr_requrl[$index]) ? $this->arr_requrl[$index] : "\x32"; $this->arr_req_rejected[] = $c36; $this->error("\133{$index}\x20\75\x20{$c36}\40\x3d\40\162\x65\152\145\143\x74\x65\144\x5d"); })); $promise = $pool->promise(); $promise->wait(); echo "\75\x3d\75\75\x3d\x3d\75\x3d\x3d\75\x3d\75\75\75\75\x3d\75\x3d\x3d\x3d\x3d\x3d\75\x3d\75\75\x3d\75\x3d\x3d\75\x3d\75\75\x3d\75\x3d\x3d\x3d"; } } public $arr_requrl; public $arr_req_rejected; public function handle_movie($moviemax = 128) { $cf = \App\Tools\CrawlerUpdate::get_crawler_config(); $this->sphost = $cf["\x6a\141\166\154\151\142\x68\157\x73\x74"]; $this->hosturl = "\x68\164\x74\x70\x3a\x2f\x2f{$this->sphost}\x2f"; $start_type = "\x6d\x6f\166\x69\145"; $headers = array("\x41\143\143\145\x70\x74" => "\x74\x65\170\164\x2f\150\164\x6d\x6c\54\141\x70\160\x6c\x69\x63\141\x74\151\x6f\x6e\x2f\170\150\164\155\154\x2b\x78\155\x6c\x2c\141\160\x70\x6c\x69\x63\141\x74\x69\x6f\x6e\57\x78\x6d\154\73\161\75\60\x2e\x39\x2c\151\155\x61\x67\145\x2f\167\x65\x62\x70\54\x69\x6d\141\147\x65\x2f\141\160\156\x67\54\52\x2f\52\x3b\x71\75\60\x2e\70", "\x41\143\143\x65\x70\164\55\x45\156\x63\157\144\151\x6e\147" => "\147\172\x69\x70\x2c\40\144\145\146\154\x61\x74\145", "\x41\x63\143\x65\160\164\55\114\141\156\147\165\x61\x67\x65" => "\x7a\x68\55\x43\x4e\54\x7a\x68\x3b\x71\x3d\60\56\x39\x2c\x65\156\73\x71\x3d\x30\x2e\x38", "\x43\141\x63\150\145\55\103\157\x6e\164\162\x6f\154" => "\x6d\x61\x78\55\141\x67\145\75\x30", "\103\x6f\x6e\156\x65\143\164\x69\157\156" => "\x6b\145\x65\x70\x2d\141\154\x69\x76\145", "\103\157\157\153\x69\145" => "\x5f\x5f\x63\146\x64\x75\151\x64\75\144\145\x35\70\142\65\x34\60\x35\x35\60\64\x33\x37\x64\144\145\144\x39\x65\x64\x66\x38\x30\66\145\61\65\145\71\67\x39\62\x31\x35\65\x38\66\x33\x31\x37\64\x30\73\40\x74\151\x6d\x65\172\x6f\156\145\x3d\x2d\x34\70\60\x3b\40\x6f\x76\x65\x72\61\x38\75\61\70\73\x20\137\137\x71\x63\x61\75\120\x30\55\61\x30\x36\61\66\63\60\65\x30\65\55\61\x35\65\x38\x36\x33\x31\67\x34\64\x35\61\67\73\40\x48\155\x5f\x6c\x76\x74\137\142\x66\x63\66\143\x32\63\x39\x37\x34\146\x62\141\x64\x30\x62\142\x66\x65\x64\x32\65\x66\x38\70\x61\x39\67\63\x66\x62\60\75\x31\x35\x35\70\x36\x33\62\66\x35\x37\x3b\x20\x48\x6d\x5f\x6c\160\166\164\x5f\142\x66\x63\x36\143\62\63\71\67\x34\146\x62\x61\x64\x30\142\x62\x66\145\144\x32\65\x66\x38\70\x61\71\67\63\146\142\x30\75\61\x35\65\70\x36\63\62\66\x38\x31", "\110\x6f\x73\x74" => $this->sphost, "\125\160\147\x72\141\144\145\x2d\111\x6e\x73\145\x63\x75\162\x65\x2d\122\x65\161\165\145\163\x74\163" => "\61", "\125\x73\x65\x72\x2d\x41\x67\x65\x6e\x74" => "\115\x6f\172\x69\x6c\154\141\x2f\x35\56\60\40\x28\127\151\x6e\x64\x6f\167\163\40\116\124\40\x31\x30\56\60\73\40\x57\x4f\127\66\x34\x29\40\x41\160\160\x6c\145\127\x65\142\113\151\x74\57\x35\x33\x37\56\63\x36\40\50\113\110\x54\115\114\54\x20\x6c\x69\x6b\x65\x20\x47\x65\x63\153\x6f\51\x20\x43\150\x72\x6f\x6d\145\x2f\67\62\x2e\x30\56\x33\66\x32\66\56\x38\x31\x20\123\x61\x66\141\x72\151\57\x35\x33\x37\56\x33\66"); $this->crawler_client_init($this->hosturl, $start_type, $this->table_prefix, $headers); $sql = "\163\x65\x6c\x65\143\x74\x20\166\151\x64\40\x66\x72\157\x6d\40\141\166\x62\x6f\157\x6b\137\x6a\141\x76\154\151\142\137\166\x69\144\x20"; $this->info($sql); $table_vid = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $this->info(count($table_vid)); $sql = "\x73\145\x6c\x65\x63\164\40\x63\157\x64\145\x5f\63\x36\40\x66\x72\x6f\x6d\x20\x61\x76\142\157\157\153\x5f\x6a\141\x76\x6c\x69\142\137\x6d\157\x76\x69\x65\x20"; $this->info($sql); $table_code_36 = $this->database->query($sql)->fetchAll(\PDO::FETCH_COLUMN, 0); $this->info(count($table_code_36)); $this->arr_req_rejected = array_diff($table_vid, $table_code_36); while (1) { if (!empty($this->arr_req_rejected)) { $this->arr_req_code_36 = array_values($this->arr_req_rejected); $this->arr_req_rejected = array(); } else { break; } $total = count($this->arr_req_code_36); if ($total == 1 && $this->arr_req_code_36[0] == '') { $this->info("\40\xe6\225\260\351\x87\x8f\xef\274\x9a\x20{$total}"); break; } $this->info("{$this->start_type}\40\345\215\207\347\272\247\xe6\225\260\351\x87\217\357\xbc\x9a\40{$total}"); $requests = function ($total) { foreach ($this->arr_req_code_36 as $key => $item) { $uri = "\150\x74\164\160\x3a\x2f\57" . $this->sphost . "\x2f\x63\156\x2f\x3f\166\75" . $item; echo "\x5b\345\275\x93\345\211\215\50{$key}\51\40\346\x80\273\xe6\x95\xb0\50{$total}\x29\174\x20\x3d\x28{$item}\51\55\174\135"; (yield new Request("\x47\105\x54", $uri)); } }; $this->sprequests = $requests($total); $pool = new Pool($this->spclient, $this->sprequests, array("\143\x6f\156\143\165\x72\x72\145\156\143\x79" => 64, "\157\160\164\x69\157\x6e\x73" => array("\164\x69\155\x65\157\165\x74" => 18), "\146\x75\x6c\x66\x69\x6c\x6c\x65\144" => function ($response, $index) { $code = $response->getStatusCode(); $c36 = $this->arr_req_code_36[$index]; if ($code == 200) { echo "\x5b\147\x65\164\x20\162\145\163\x3a{$index}\40\40{$c36}\40\x5d\12"; $d = $this->get_info_movie($response, $c36); if (empty($d)) { if (!empty($c36)) { $this->arr_req_rejected[] = $c36; } } else { $this->database->insert("\141\x76\x62\157\x6f\153\137\152\141\166\154\151\x62\137\155\x6f\166\151\145", $d); } } else { $this->arr_req_rejected[] = $c36; } }, "\x72\145\152\145\x63\164\x65\x64" => function ($reason, $index) { $c36 = isset($this->arr_req_code_36[$index]) ? $this->arr_req_code_36[$index] : "\x32"; $this->arr_req_rejected[] = $c36; $this->error("\x5b{$index}\40\x3d\x20{$c36}\x20\75\x20\162\145\x6a\145\143\x74\x65\x64\x5d"); })); $promise = $pool->promise(); $promise->wait(); echo "\75\75\x3d\x3d\x3d\75\75\x3d\75\x3d\75\75\75\x3d\x3d\75\75\x3d\x3d\75\75\75\x3d\x3d\x3d\75\x3d\75\x3d\75\x3d\x3d\x3d\x3d\75\75\x3d\75\x3d"; } } public function get_info_movie($response, $c_36 = '') { $original_body = (string) $response->getBody(); $content = mb_convert_encoding($original_body, "\x55\124\106\55\70", $this->spcharset); if (strpos($content, "\74\57\x68\164\155\x6c\x3e") === false) { echo "\xe9\xa1\xb5\xe9\x9d\242\344\270\215\xe5\xae\x8c\xe6\225\264"; return null; } $arr_data = array(); $arr_data["\x63\157\144\x65\137\x33\x36"] = $c_36; $arr_data["\x63\157\x64\145\137\x31\x30"] = base_convert($c_36, 36, 10); $code_36 = $c_36; preg_match("\x23\74\x74\x64\40\143\154\x61\163\163\75\x22\x68\145\141\144\x65\162\42\x3e\350\257\x86\xe5\210\xab\347\240\201\x3a\x3c\x2f\x74\x64\x3e\x5b\134\163\x5d\x2a\x3f\x3c\x74\x64\x20\x63\154\141\163\x73\75\x22\x74\145\170\164\42\x3e\50\56\x2a\x3f\x29\74\x2f\x74\x64\76\x23", $content, $out); $censored_id = empty($out[1]) ? '' : $out[1]; $arr_data["\x63\x65\156\163\x6f\162\145\x64\x5f\x69\x64"] = $censored_id; preg_match("\43\74\x74\x69\x74\154\145\x3e\50\x2e\52\77\x29\40\x2d\x20\112\x41\x56\x4c\151\x62\x72\x61\162\x79\x3c\x2f\164\151\164\154\145\x3e\43", $content, $out); $arr_data["\155\x6f\x76\151\145\137\x74\151\164\x6c\x65"] = empty($out[1]) ? '' : trim(str_replace($censored_id, '', $out[1])); preg_match("\43\151\x64\x3d\42\x76\x69\144\145\x6f\137\152\141\143\153\145\164\137\x69\155\x67\42\40\163\162\x63\x3d\42\50\56\x2a\x3f\x29\42\43", $content, $out); $arr_data["\x6d\157\x76\x69\145\137\160\x69\x63\x5f\143\x6f\x76\x65\162"] = empty($out[1]) ? '' : str_replace(array("\x68\x74\x74\160\72\x2f\x2f\x70\151\143\x73\56\x64\155\x6d\56\x63\x6f\x2e\x6a\160\57\x6d\157\156\x6f\57\x6d\x6f\x76\x69\x65\57\x61\144\165\154\x74\57", "\x2f\57\x70\x69\143\163\56\144\155\x6d\x2e\x63\157\x2e\152\x70\x2f\x6d\157\156\x6f\57\x6d\x6f\166\151\145\x2f\x61\x64\x75\x6c\x74\x2f"), '', $out[1]); preg_match("\x23\x3c\x74\144\40\x63\x6c\141\x73\163\x3d\x22\x68\145\x61\x64\145\162\42\76\xe5\x8f\221\350\xa1\x8c\346\x97\245\xe6\x9c\x9f\x3a\x3c\57\x74\144\76\x5b\134\163\x5d\52\x3f\74\164\144\40\143\154\141\163\x73\x3d\42\164\145\170\x74\42\x3e\50\x2e\x2a\77\51\x3c\x2f\x74\x64\x3e\43", $content, $out); $arr_data["\162\145\154\x65\141\163\145\x5f\x64\141\164\145"] = empty($out[1]) ? '' : $out[1]; preg_match("\x23\74\164\x64\x20\143\154\x61\x73\163\75\42\150\x65\x61\x64\145\x72\x22\76\351\x95\277\xe5\xba\xa6\x3a\x3c\x2f\x74\x64\x3e\x5b\134\x73\x5d\x2a\77\74\x74\144\76\x3c\x73\x70\x61\x6e\x20\x63\x6c\141\x73\163\x3d\42\164\145\x78\x74\x22\x3e\50\56\x2a\x3f\51\74\x2f\x73\x70\141\156\76\40\xe5\210\206\xe9\x92\x9f\x3c\x2f\164\144\76\43", $content, $out); $arr_data["\x6d\x6f\x76\x69\x65\x5f\154\145\x6e\x67\164\x68"] = empty($out[1]) ? '' : $out[1]; preg_match("\x23\150\x72\x65\146\75\42\166\x6c\x5f\x64\x69\x72\x65\143\164\x6f\x72\x2e\160\150\160\x5c\x3f\x64\x3d\x28\56\x2a\x3f\x29\42\x23", $content, $out); $arr_data["\x44\x69\x72\x65\x63\164\x6f\162"] = empty($out[1]) ? '' : $out[1]; preg_match("\43\150\x72\x65\146\75\42\166\154\137\x6d\141\153\x65\162\x2e\x70\x68\x70\134\77\155\x3d\50\56\x2a\x3f\x29\x22\43", $content, $out); $arr_data["\x53\x74\165\144\x69\x6f"] = empty($out[1]) ? '' : $out[1]; preg_match("\x23\150\x72\145\x66\75\42\166\154\137\154\x61\x62\145\x6c\x2e\x70\x68\160\x5c\x3f\154\75\x28\56\52\x3f\x29\x22\x23", $content, $out); $arr_data["\x4c\141\x62\145\x6c"] = empty($out[1]) ? '' : $out[1]; preg_match("\x23\74\x73\160\x61\x6e\x20\x63\154\x61\163\x73\75\x22\x73\143\x6f\x72\x65\x22\76\134\50\50\x2e\x2a\77\51\x5c\x29\74\x2f\x73\x70\141\x6e\76\x23", $content, $out); $arr_data["\163\143\157\x72\x65"] = empty($out[1]) ? '' : floatval($out[1]); preg_match_all("\43\x68\x72\x65\146\75\42\x76\154\137\x67\x65\x6e\x72\x65\56\x70\150\160\134\x3f\x67\x3d\50\x2e\52\x3f\x29\42\43", $content, $out); $arr_data["\107\145\x6e\162\x65"] = empty($out[1]) ? '' : "\x5b" . implode("\x5d\133", $out[1]) . "\135"; preg_match_all("\43\150\162\x65\146\x3d\42\x76\x6c\137\163\x74\141\x72\x2e\x70\150\160\x5c\77\x73\x3d\x28\56\x2a\77\x29\x22\43", $content, $out); $arr_data["\x4a\101\126\x5f\x49\x64\x6f\x6c\x73"] = empty($out[1]) ? '' : "\133" . implode("\135\x5b", $out[1]) . "\135"; $s = "\74\x61\40\150\x72\145\146\x3d\42\x75\x73\x65\162\163\167\141\x6e\x74\145\x64\x2e\160\150\160\x5c\x3f\x76\x3d" . $code_36 . "\x22\x3e\x28\x2e\x2a\x3f\x29\74\57\141\x3e"; preg_match("\43{$s}\43", $content, $out); $arr_data["\165\x73\145\162\163\167\x61\x6e\x74\x65\144"] = empty($out[1]) ? '' : $out[1]; preg_match("\43\150\162\x65\146\75\42\165\163\145\x72\163\x77\x61\x74\x63\150\145\144\x2e\x70\x68\x70\134\77\x76\x3d" . $code_36 . "\x22\x3e\50\56\x2a\x3f\51\x3c\57\141\x3e\43", $content, $out); $arr_data["\x75\x73\145\x72\163\x77\141\x74\x63\150\x65\x64"] = empty($out[1]) ? '' : $out[1]; preg_match("\43\150\x72\145\x66\x3d\42\x75\163\145\x72\163\x6f\167\156\145\x64\x2e\160\150\160\x5c\77\166\75" . $code_36 . "\x22\x3e\x28\x2e\52\77\51\74\57\x61\x3e\x23", $content, $out); $arr_data["\165\163\145\162\163\x6f\167\156\x65\144"] = empty($out[1]) ? '' : $out[1]; $arr_data["\x63\x6f\x6d\155\x65\156\x74\163"] = strpos($content, "\x3c\x65\x6d\76\347\251\272\xe7\x9a\x84\xe5\x88\x97\350\241\250\74\57\x65\155\76") === false ? 1 : 0; return $arr_data; } }

Function Calls

None

Variables

None

Stats

MD5 ab8744c81863858670f641a58cf452ea
Eval Count 0
Decode Time 113 ms