Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- /**
- *
- */
- class Booking
- {
- public function sdata($url , $custom , $delCookies = null){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HEADER, false);
- if($custom[uagent]){
- curl_setopt($ch, CURLOPT_USERAGENT, $custom[uagent]);
- }else{
- curl_setopt($ch, CURLOPT_USERAGENT, "msnbot/1.0 (+http://search.msn.com/msnbot.htm)");
- }
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
- if($custom[rto]){
- curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
- }else{
- curl_setopt($ch, CURLOPT_TIMEOUT, 60);
- }
- if($custom[header]){
- curl_setopt($ch, CURLOPT_HTTPHEADER, $custom[header]);
- }
- curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd()."/cookies.txt");
- curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd()."/cookies.txt");
- curl_setopt($ch, CURLOPT_VERBOSE, false);
- if($custom[post]){
- if(is_array($custom[post])){
- $query = http_build_query($custom[post]);
- }else{
- $query = $custom[post];
- }
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
- }
- $data = curl_exec($ch);
- $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- return array(
- 'data' => json_decode($data , true),
- 'html' => $data ,
- 'httpcode' => $httpcode,
- );
- }
- public function ListFilm(){
- $cu = array(
- 'header' => array(
- "referer: https://id.bookmyshow.com/cilegon",
- "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",
- "x-requested-with: XMLHttpRequest"
- ));
- echo "[BMS] Sedang ngeCurl Lokasi ... \r\n";
- $this->sdata("https://id.bookmyshow.com/jakarta",$cu,null);
- echo "[BMS] Sedang ngeCurl Film ...\r\n";
- $film = $this->sdata("https://id.bookmyshow.com/film/",$cu,null);
- preg_match_all('/><h2 class="header">(.*?)<\/h2><div class="content"><a href="(.*?)"><span class="__format">2D<\/span>/', $film['html'], $matches);
- foreach ($matches[2] as $key => $sitene) {
- $sitene = "https://id.bookmyshow.com".$sitene;
- echo "[BMS] Booking Film : ".$sitene."\r\n";
- $getFilm = $this->sdata($sitene,$cu,null);
- preg_match_all('/data-session-id="(.*?)"/', $getFilm['html'], $dataSession);
- preg_match_all('/data-venue-code="(.*?)"/', $getFilm['html'], $venueCode);
- foreach ($dataSession[1] as $key => $sessioncodeTiket) {
- echo "[BMS] Session ID : ".$sessioncodeTiket."\r\n";
- $cus = array(
- 'header' => array(
- "referer: https://id.bookmyshow.com/cilegon",
- "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",
- "x-requested-with: XMLHttpRequest"
- ),
- 'post' => 'a=WEBIDN&v='.$venueCode[1][$key].'&t=0&c=GETSEATLAYOUT&p1='.$sessioncodeTiket.'&p2=WEB&p3=&p4=&p5=&p6=&p7=Y&p8=&p9=&p10=',
- );
- $bookingSeat = $this->sdata("https://id.bookmyshow.com/serv/doSecureTrans.bms",$cus,null);
- preg_match_all('/<blnSuccess>true<\/blnSuccess>/', $bookingSeat['html'], $btnSucc);
- preg_match_all('/<strData>(.*?)<\/strData>/', $bookingSeat['html'], $setData);
- if($btnSucc[0][0]){
- $step1 = $this->sdata("https://id.bookmyshow.com/serv/doSecureTrans.bms",array(
- 'header' => array(
- "referer: https://id.bookmyshow.com/cilegon",
- "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",
- "x-requested-with: XMLHttpRequest"),
- 'post' => 'a=WEBIDN&v=CBLT&t=0&c=INITTRANS&p1=&p2=&p3=&p4=&p5=&p6=&p7=&p8=&p9=&p10=',
- ),null);
- preg_match_all('/<strData>(.*?)<\/strData>/', $step1['html'], $transaID);
- $trxID = str_replace("|", "", $transaID[1][0]);
- $trxID = str_replace("TRANSACTIONID=", "", $trxID);
- $num = rand(7,8).rand(1000000,8000000);
- $tiket = "402".rand(1,8).rand(1,8).rand(1,8).rand(1,8);
- $payload = '{"uip":"'.$sessioncodeTiket.'","email":"me.'.$tiket.'@gmail.com","mob":"8585'.$num.'","card_no":"","nb_code":""}';
- $ops = array(
- 'header' => array(
- "accept: application/xml, text/xml, */*; q=0.01",
- "cache-control: no-cache",
- "connection: keep-alive",
- "content-type: application/x-www-form-urlencoded",
- "dnt: 1",
- "host: id.bookmyshow.com",
- "referer: https://id.bookmyshow.com/payment/?cid=CBLT&sid=".$sessioncodeTiket."&ety=MT&ec=ET00004175",
- "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:49.0) Gecko/20100101 Firefox/49.0",
- "x-requested-with: XMLHttpRequest"
- ),
- 'post' => "a=WEBIDN&v=CBLT&t=".$tiket."&c=SETOFFERVIACOMP&p1=".$payload."&p2=&p3=&p4=&p5=&p6=&p7=&p8=&p9=&p10="
- );
- $post = $this->sdata("https://id.bookmyshow.com/serv/doSecureTrans.bms",$ops)['html'];
- print_r($post);
- }
- }
- }
- /*$iget = $this->sdata("https://id.bookmyshow.com/serv/getData?cmd=QUICKBOOK&type=MT&getRecommendedData=1",$cu,null);
- print_r($iget['data']['moviesData']['BookMyShow']['arrEvents']);
- unlink("cookies.txt");*/
- }
- }
- $Booking = new Booking;
- $Booking->ListFilm();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement