Advertisement
bug7sec

Untitled

Jun 16th, 2017
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.53 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. /**
  4. *
  5. */
  6. class Booking
  7. {
  8.     public function sdata($url , $custom , $delCookies = null){
  9.         $ch = curl_init();
  10.         curl_setopt($ch, CURLOPT_URL, $url);
  11.         curl_setopt($ch, CURLOPT_HEADER, false);
  12.         if($custom[uagent]){
  13.             curl_setopt($ch, CURLOPT_USERAGENT, $custom[uagent]);
  14.         }else{
  15.             curl_setopt($ch, CURLOPT_USERAGENT, "msnbot/1.0 (+http://search.msn.com/msnbot.htm)");
  16.         }
  17.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  18.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  19.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  20.         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  21.         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
  22.         if($custom[rto]){
  23.             curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
  24.         }else{
  25.             curl_setopt($ch, CURLOPT_TIMEOUT, 60);
  26.         }
  27.         if($custom[header]){
  28.             curl_setopt($ch, CURLOPT_HTTPHEADER, $custom[header]);
  29.         }
  30.         curl_setopt($ch, CURLOPT_COOKIEJAR,  getcwd()."/cookies.txt");
  31.         curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd()."/cookies.txt");
  32.         curl_setopt($ch, CURLOPT_VERBOSE, false);
  33.         if($custom[post]){
  34.             if(is_array($custom[post])){
  35.                 $query = http_build_query($custom[post]);
  36.             }else{
  37.                 $query = $custom[post];
  38.             }
  39.             curl_setopt($ch, CURLOPT_POST, true);
  40.             curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
  41.         }
  42.         $data           = curl_exec($ch);
  43.         $httpcode       = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  44.         curl_close($ch);
  45.         return array(
  46.             'data'      => json_decode($data , true),
  47.             'html'      => $data ,
  48.             'httpcode'  => $httpcode,
  49.         );
  50.     }
  51.     public function ListFilm(){
  52.         $cu     = array(
  53.             'header' => array(
  54.                 "referer: https://id.bookmyshow.com/cilegon",
  55.                 "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  56.                 "x-requested-with: XMLHttpRequest"
  57.         ));
  58.         echo "[BMS] Sedang ngeCurl Lokasi ... \r\n";
  59.         $this->sdata("https://id.bookmyshow.com/jakarta",$cu,null);
  60.         echo "[BMS] Sedang ngeCurl Film ...\r\n";
  61.         $film = $this->sdata("https://id.bookmyshow.com/film/",$cu,null);
  62.         preg_match_all('/><h2 class="header">(.*?)<\/h2><div class="content"><a href="(.*?)"><span class="__format">2D<\/span>/', $film['html'], $matches);
  63.         foreach ($matches[2] as $key => $sitene) {
  64.             $sitene = "https://id.bookmyshow.com".$sitene;
  65.             echo "[BMS] Booking Film : ".$sitene."\r\n";   
  66.             $getFilm = $this->sdata($sitene,$cu,null);
  67.             preg_match_all('/data-session-id="(.*?)"/', $getFilm['html'], $dataSession);
  68.             preg_match_all('/data-venue-code="(.*?)"/', $getFilm['html'], $venueCode);
  69.             foreach ($dataSession[1] as $key => $sessioncodeTiket) {
  70.                 echo "[BMS] Session ID : ".$sessioncodeTiket."\r\n";
  71.                 $cus            = array(
  72.                     'header' => array(
  73.                         "referer: https://id.bookmyshow.com/cilegon",
  74.                         "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  75.                         "x-requested-with: XMLHttpRequest"
  76.                 ),
  77.                 'post' => 'a=WEBIDN&v='.$venueCode[1][$key].'&t=0&c=GETSEATLAYOUT&p1='.$sessioncodeTiket.'&p2=WEB&p3=&p4=&p5=&p6=&p7=Y&p8=&p9=&p10=',
  78.                 );
  79.                 $bookingSeat    = $this->sdata("https://id.bookmyshow.com/serv/doSecureTrans.bms",$cus,null);
  80.                 preg_match_all('/<blnSuccess>true<\/blnSuccess>/', $bookingSeat['html'], $btnSucc);
  81.                 preg_match_all('/<strData>(.*?)<\/strData>/', $bookingSeat['html'], $setData);
  82.                 if($btnSucc[0][0]){
  83.  
  84.                     $step1 = $this->sdata("https://id.bookmyshow.com/serv/doSecureTrans.bms",array(
  85.                         'header' => array(
  86.                         "referer: https://id.bookmyshow.com/cilegon",
  87.                         "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  88.                         "x-requested-with: XMLHttpRequest"),
  89.                         'post' => 'a=WEBIDN&v=CBLT&t=0&c=INITTRANS&p1=&p2=&p3=&p4=&p5=&p6=&p7=&p8=&p9=&p10=',
  90.                     ),null);
  91.                     preg_match_all('/<strData>(.*?)<\/strData>/', $step1['html'], $transaID);
  92.                     $trxID = str_replace("|", "", $transaID[1][0]);
  93.                     $trxID = str_replace("TRANSACTIONID=", "", $trxID);
  94.                     $num        =  rand(7,8).rand(1000000,8000000);
  95.                     $tiket      = "402".rand(1,8).rand(1,8).rand(1,8).rand(1,8);
  96.                     $payload    = '{"uip":"'.$sessioncodeTiket.'","email":"me.'.$tiket.'@gmail.com","mob":"8585'.$num.'","card_no":"","nb_code":""}';
  97.                     $ops  = array(
  98.                     'header' =>  array(
  99.                             "accept: application/xml, text/xml, */*; q=0.01",
  100.                             "cache-control: no-cache",
  101.                             "connection: keep-alive",
  102.                             "content-type: application/x-www-form-urlencoded",
  103.                             "dnt: 1",
  104.                             "host: id.bookmyshow.com",
  105.                             "referer: https://id.bookmyshow.com/payment/?cid=CBLT&sid=".$sessioncodeTiket."&ety=MT&ec=ET00004175",
  106.                             "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:49.0) Gecko/20100101 Firefox/49.0",
  107.                             "x-requested-with: XMLHttpRequest"
  108.                     ),
  109.                     'post' => "a=WEBIDN&v=CBLT&t=".$tiket."&c=SETOFFERVIACOMP&p1=".$payload."&p2=&p3=&p4=&p5=&p6=&p7=&p8=&p9=&p10="
  110.                     );
  111.                     $post       = $this->sdata("https://id.bookmyshow.com/serv/doSecureTrans.bms",$ops)['html'];
  112.                     print_r($post);
  113.                 }
  114.             }
  115.         }
  116.         /*$iget     = $this->sdata("https://id.bookmyshow.com/serv/getData?cmd=QUICKBOOK&type=MT&getRecommendedData=1",$cu,null);
  117.         print_r($iget['data']['moviesData']['BookMyShow']['arrEvents']);
  118.         unlink("cookies.txt");*/
  119.     }
  120. }
  121. $Booking = new Booking;
  122. $Booking->ListFilm();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement