bug7sec

wkwkwk jangan di buka

Oct 22nd, 2016
1,014
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.96 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3.     function ngecurl($url , $post=null , $header=null){
  4.             $ch = curl_init($url);
  5.             if($post != null) {
  6.                 curl_setopt($ch, CURLOPT_POST, true);
  7.                 curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  8.             }
  9.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10.             curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36");
  11.             curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd().'/'."cookies.txt");
  12.             curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd().'/'."cookies.txt");
  13.             curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
  14.             if($header != null) {
  15.                 curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
  16.             }
  17.             curl_setopt($ch, CURLOPT_COOKIESESSION, true);
  18.             curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
  19.             curl_setopt($ch, CURLOPT_TIMEOUT, 20);
  20.             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  21.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  22.             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  23.             unlink("cookies.txt");
  24.             return curl_exec($ch);
  25.             curl_close($ch);
  26.     }
  27.     function clean($string) {
  28.         $string = str_replace(' ', '-', $string);
  29.         return preg_replace('/[^A-Za-z0-9\-]/', '', $string);
  30.     }
  31.     $re = '/\'Category (.*?)\'\);" alt="(.*?)"/';
  32.     $str = ngecurl("http://www.pornhub.com/video?c=111");
  33.     preg_match_all($re, $str , $matches);
  34.     echo "------[ Category ]-------\r\n";
  35.     foreach ($matches[1] as $key => $value) {
  36.         $idcata[]   = $value;
  37.         $cataname[] = $matches[2][$key];
  38.     }
  39.     if($idcata != null){
  40.         foreach ($idcata as $key => $idcatas) {
  41.             $catanams = $cataname[$key];
  42.             for ($i=0; $i <150; $i++) {
  43.                 preg_match_all('/<a href="(.*?)" title="(.*?)">(.*?)<\/a>/', ngecurl("http://www.pornhub.com/video?c=".$idcatas."&page=".$i) , $matches);
  44.                 foreach ($matches[0] as $key => $value) {
  45.                     $re = '/\/view_video\.php\?viewkey=/';
  46.                     preg_match_all($re, $value, $matches);
  47.                     if($matches[0][0]){
  48.                         $re = '/<a href="(.*?)" title="(.*?)">/';
  49.                         preg_match_all($re, $value, $matches);
  50.                         $link        = "http://www.pornhub.com".$matches[1][0];
  51.                         $links[]     = $link."\r\n";
  52.                         $item        = array(
  53.                             'link'   => $link,
  54.                             'title1' => $matches[2][0] ,
  55.                             'title2' => clean($matches[2][0])
  56.                         );
  57.                         $data[]     = $item;
  58.                     }
  59.                 }
  60.                 echo "Page : ".$i." | Cata : ".$catanams." Total : ".count($links)."\r\n";
  61.             }
  62.         }
  63.         echo "Total : ".count(array_unique($links))."\r\n";
  64.         if( file_put_contents("asu.json", json_encode(array('pornhub' => $data)))){
  65.             echo "SUDAH DI SAVE\r\n";
  66.         }else{
  67.             print_r(json_encode(array('pornhub' => $data)));
  68.         }
  69.         if( file_put_contents("link.json", json_encode(array('pornhub' => array($links))))){
  70.             echo "SUDAH DI SAVE\r\n";
  71.         }else{
  72.             print_r(json_encode(array('pornhub' => $data)));
  73.         }
  74.     }else{
  75.         echo "ID NULL COK\r\n";
  76.         exit();
  77.     }
Add Comment
Please, Sign In to add comment