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

Function Calls

None

Variables

None

Stats

MD5 cdd5da11c5326b3aa94fc6c6a6981ae8
Eval Count 0
Decode Time 125 ms