Advertisement
Guest User

marl

a guest
Apr 18th, 2019
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.63 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Thanks To : Janu Yoga & Aan Ahmad
  5. * Date Share : 27-03-2019
  6. * Date Updated : 18-04-2019
  7. **/
  8.  
  9. date_default_timezone_set("Asia/Jakarta");
  10. class Marlboro
  11. {
  12. protected $cookie;
  13. protected $modules;
  14.  
  15. public function __construct()
  16. {
  17. $this->modules = new modules();
  18. }
  19.  
  20. private function cookiesAkun()
  21. {
  22. $file = "cookiesAkun.txt";
  23. foreach(explode("\n", str_replace("\r", "", file_get_contents($file))) as $a => $data)
  24. {
  25. return array("cookie" => @explode("|", trim($data))[0], "email" => @explode("|", trim($data))[1], "password" => @explode("|", trim($data))[2], "deviceid" => @explode("|", trim($data))[3]);
  26. }
  27. }
  28.  
  29. private function login($email, $password)
  30. {
  31. if(@file_exists("cookiesAkun.txt") == true){@unlink("cookiesAkun.txt");}if(@file_exists("cookiesMarlboro.txt") == true){@unlink("cookiesMarlboro.txt");}
  32.  
  33. $cook = $this->modules->fetchCookies($this->modules->curl("https://www.marlboro.id", null, false, false, true, array("Host: www.marlboro.id"), 'GET'));
  34. $headers = array();
  35. $headers[] = "Content-Type: application/x-www-form-urlencoded; charset=UTF-8";
  36. $headers[] = "Cookie: decide_session=".$cook['decide_session'];
  37. $headers[] = "Host: www.marlboro.id";
  38. $headers[] = "Origin: https://www.marlboro.id";
  39. $headers[] = "Referer: https://www.marlboro.id/";
  40. $headers[] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW".rand(000, 999).") AppleWebKit/".rand(00000, 99999).".36 (KHTML, like Gecko) Chrome/72.0.".rand(00000, 99999).".".rand(00000, 99999)." Safari/".rand(00000, 99999).".36";
  41. $headers[] = "X-Requested-With: XMLHttpRequest";
  42. $csrf = $this->modules->getStr($this->modules->curl("https://www.marlboro.id", null, false, false, false, $headers, 'GET'), 'name="decide_csrf" value="', '"', 1, 0);
  43. $login = $this->modules->curl("https://www.marlboro.id/auth/login", "email=".$email."&password=".$password."&decide_csrf=".$csrf."&ref_uri=/", true, false, true, $headers);
  44. $cookies = $this->modules->fetchCookies($login)['decide_session'];
  45. $deviceid = $this->modules->fetchCookies($login)['deviceId'];
  46. $this->modules->fwrite("cookiesAkun.txt", @$cookies."|".$email."|".$password."|".$deviceid);
  47. return $login;
  48. }
  49.  
  50. private function idVidio()
  51. {
  52. $headers = array();
  53. $headers[] = "Content-Type: application/x-www-form-urlencoded; charset=UTF-8";
  54. $headers[] = "Cookie: deviceId=".$this->cookiesAkun()['deviceid']."; decide_session=".$this->cookiesAkun()['cookie'];
  55. $headers[] = "Host: www.marlboro.id";
  56. $listIdVidio = $this->modules->curl("https://www.marlboro.id", null, false, true, false, $headers, 'GET');
  57. return $listIdVidio;
  58. }
  59.  
  60. protected function view($idVidio)
  61. {
  62. $headers = array();
  63. $headers[] = "Content-Type: application/x-www-form-urlencoded; charset=UTF-8";
  64. $headers[] = "Cookie: deviceId=".$this->cookiesAkun()['deviceid']."; ev=1; ins-mig-done=1; _ga=GA1.2.1672508626.1555546081; _gid=GA1.2.729002869.1555546081; accC=true; _mm3rm4bre_=rSeKzRiEheLzUTorfCf69vjAKxUkc3ltb3VoJC4zNDUyYTVqZXFqeGtrY3Njdml6cHE%3D; content_viewc=6; mp_41fb5b1708a7763a1be4054da0f74d65_mixpanel=%7B%22distinct_id%22%3A%20%2216a2dc57eb742c-0cd20e09d512b1-e323069-100200-16a2dc57eb855e%22%2C%22%24device_id%22%3A%20%2216a2dc57eb742c-0cd20e09d512b1-e323069-100200-16a2dc57eb855e%22%2C%22%24initial_referrer%22%3A%20%22%24direct%22%2C%22%24initial_referring_domain%22%3A%20%22%24direct%22%7D; token=18WVsm4NZxDp8Dnfn8FQhJ3PnOnwdaWD; refresh_token=nMlb6ERG1fFqktkFT1oeTtqgghV0W5TX; _gat_UA-102334128-3=1; decide_session=".$this->cookiesAkun()['cookie'];
  65. $headers[] = "Host: www.marlboro.id";
  66. $headers[] = "Origin: https://www.marlboro.id";
  67. $headers[] = "Referer: https://www.marlboro.id/";
  68. $headers[] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW".rand(000, 999).") AppleWebKit/".rand(00000, 99999).".36 (KHTML, like Gecko) Chrome/72.0.".rand(00000, 99999).".".rand(00000, 99999)." Safari/".rand(00000, 99999).".36";
  69. $headers[] = "X-Requested-With: XMLHttpRequest";
  70. $csrf = $this->modules->getStr($this->modules->curl("https://www.marlboro.id/", null, false, true, false, $headers, 'GET'), 'name="decide_csrf" value="', '"', 1, 0);
  71. $view = $this->modules->curl("https://www.marlboro.id/article/play-video/".$idVidio, "decide_csrf=".$csrf."&log_id=false&duration=0.007&total_duration=0", false, false, true, $headers);
  72. return $view;
  73. }
  74.  
  75. protected function update($idVidio, $decide_session)
  76. {
  77. $headers = array();
  78. $headers[] = "Content-Type: application/x-www-form-urlencoded; charset=UTF-8";
  79. $headers[] = "Cookie: deviceId=".$this->cookiesAkun()['deviceid']."; ev=1; ins-mig-done=1; _ga=GA1.2.1672508626.1555546081; _gid=GA1.2.729002869.1555546081; accC=true; _mm3rm4bre_=rSeKzRiEheLzUTorfCf69vjAKxUkc3ltb3VoJC4zNDUyYTVqZXFqeGtrY3Njdml6cHE%3D; content_viewc=6; mp_41fb5b1708a7763a1be4054da0f74d65_mixpanel=%7B%22distinct_id%22%3A%20%2216a2dc57eb742c-0cd20e09d512b1-e323069-100200-16a2dc57eb855e%22%2C%22%24device_id%22%3A%20%2216a2dc57eb742c-0cd20e09d512b1-e323069-100200-16a2dc57eb855e%22%2C%22%24initial_referrer%22%3A%20%22%24direct%22%2C%22%24initial_referring_domain%22%3A%20%22%24direct%22%7D; token=18WVsm4NZxDp8Dnfn8FQhJ3PnOnwdaWD; refresh_token=nMlb6ERG1fFqktkFT1oeTtqgghV0W5TX; _gat_UA-102334128-3=1; decide_session=".$this->cookiesAkun()['cookie'];
  80. $headers[] = "Host: www.marlboro.id";
  81. $headers[] = "Origin: https://www.marlboro.id";
  82. $headers[] = "Referer: https://www.marlboro.id/";
  83. $headers[] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW".rand(000, 999).") AppleWebKit/".rand(00000, 99999).".36 (KHTML, like Gecko) Chrome/72.0.".rand(00000, 99999).".".rand(00000, 99999)." Safari/".rand(00000, 99999).".36";
  84. $headers[] = "X-Requested-With: XMLHttpRequest";
  85. $csrf = $this->modules->getStr($this->modules->curl("https://www.marlboro.id/", null, false, true, false, $headers, 'GET'), 'name="decide_csrf" value="', '"', 1, 0);
  86. $update = $this->modules->curl("https://www.marlboro.id/article/play-video/".$idVidio."/update", "decide_csrf=".$csrf."&log_id=false&duration=0.007&total_duration=0", false, true, false, $headers);
  87. return $update;
  88. }
  89.  
  90. private function getPoint()
  91. {
  92. $headers = array();
  93. $headers[] = "Content-Type: application/x-www-form-urlencoded; charset=UTF-8";
  94. $headers[] = "Cookie: "."deviceId=".$this->cookiesAkun()['deviceid']."; decide_session=".$this->cookiesAkun()['cookie'];
  95. $headers[] = "Host: www.marlboro.id";
  96. $get = $this->modules->curl("https://www.marlboro.id/profile", null, false, true, false, $headers, 'GET');
  97. return @$this->modules->getStr($get, '<div class="point">', '<span>', 2, 0);
  98. }
  99.  
  100. public function execute_login($email, $password)
  101. {
  102. for($o=1;$o<=20;$o++)
  103. {
  104. @$saldo_awal = $this->getPoint();
  105. $login = $this->login($email, $password);
  106. @$cookies = $this->modules->fetchCookies($login)['decide_session'];
  107. @$deviceid = $this->modules->fetchCookies($login)['deviceId'];
  108. if(strpos($login, '"code":200,"message":"success"'))
  109. {
  110. $this->modules->fwrite("cookiesAkun.txt", @$cookies."|".$email."|".$password."|".$deviceid.PHP_EOL);
  111. if(@$this->getPoint() == $saldo_awal)
  112. {
  113. print PHP_EOL."Limit Get Point Login...";
  114. return false;
  115. }else{
  116. print PHP_EOL."Success Login!, Point Anda : ".$this->getPoint();
  117. }
  118. }elseif(strpos($login, '"message":"Please Accept GoAheadPeople T&C"')){
  119. print PHP_EOL."Failed Login!, Message : Please Accept GoAheadPeople T&C.. Retry!";
  120. }else{
  121. print PHP_EOL."Failed Login";
  122. return false;
  123. }
  124. }
  125. }
  126.  
  127. public function execute_nonton($email)
  128. {
  129. print PHP_EOL."Go Bot Nonton";
  130. sleep(1);echo".";sleep(1);echo".";sleep(1);echo".";
  131. for($b = 1; $b <= 10; $b++)
  132. {
  133. @$saldo_awal = $this->getPoint();
  134. $idVidio = $this->modules->getStr($this->idVidio(), 'data-ref="https://www.marlboro.id/discovered/article/', '"', $b, 0);
  135. if(!empty($idVidio))
  136. {
  137. $view = $this->view($idVidio);
  138. $decide_session = $this->modules->fetchCookies($view)['decide_session'];
  139. if(strpos($view, '"message":"Success to store log play video."'))
  140. {
  141. print PHP_EOL."Sedang Menonton : ".$idVidio;
  142. sleep(30);
  143. $update = $this->update($idVidio, $decide_session);
  144. if(strpos($update, '"finished":true'))
  145. {
  146. if(@$this->getPoint() == @$saldo_awal)
  147. {
  148. print PHP_EOL."Limit Get Point Nonton!, Done : ".$email;
  149. return false;
  150. }else{
  151. print PHP_EOL."Success Menonton!, Point anda : ".$this->getPoint()." ";
  152. }
  153. }else{
  154. print PHP_EOL."Failed!".PHP_EOL;
  155. }
  156. }elseif(strpos($view, '"message":"Action is not allowed"')){
  157. print PHP_EOL."Failed Menonton Vidio!, Message : Action is not allowed..";
  158. return false;
  159. }else{
  160. print PHP_EOL."Response View : ".$view.PHP_EOL;
  161. }
  162. }else{
  163. print PHP_EOL."ID Vidio Tidak Ditemukan..";
  164. return false;
  165. }
  166. }
  167. }
  168. }
  169.  
  170. class modules
  171. {
  172. public function curl($url, $params, $cookie, $cookiefile, $header, $httpheaders, $request = 'POST', $socks = "")
  173. {
  174. $cookies = "cookiesMarlboro.txt";
  175. $this->ch = curl_init();
  176.  
  177. curl_setopt($this->ch, CURLOPT_URL, $url);
  178. curl_setopt($this->ch, CURLOPT_POSTFIELDS, $params);
  179. curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
  180. curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
  181. curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
  182.  
  183. curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $request);
  184.  
  185. if($cookie == true)
  186. {
  187. curl_setopt($this->ch, CURLOPT_COOKIEJAR, $cookies);
  188. }
  189.  
  190. if($cookiefile == true)
  191. {
  192. curl_setopt($this->ch, CURLOPT_COOKIEFILE, $cookies);
  193. }
  194.  
  195. curl_setopt($this->ch, CURLOPT_HEADER, $header);
  196. @curl_setopt($this->ch, CURLOPT_HTTPHEADER, $httpheaders);
  197.  
  198. curl_setopt($this->ch, CURLOPT_HTTPPROXYTUNNEL, 1);
  199. curl_setopt($this->ch, CURLOPT_PROXY, $socks);
  200. curl_setopt($this->ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
  201.  
  202. curl_setopt($this->ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
  203. $response = curl_exec($this->ch);
  204. return $response;
  205. curl_close($this->ch);
  206. }
  207.  
  208. public function getStr($page, $str1, $str2, $line_str2, $line)
  209. {
  210. $get = explode($str1, $page);
  211. $get2 = explode($str2, $get[$line_str2]);
  212. return $get2[$line];
  213. }
  214.  
  215. public function fetchCookies($source)
  216. {
  217. preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $source, $matches);
  218. $cookies = array();
  219. foreach($matches[1] as $item)
  220. {
  221. parse_str($item, $cookie);
  222. $cookies = array_merge($cookies, $cookie);
  223. }
  224.  
  225. return $cookies;
  226. }
  227.  
  228. public function fwrite($namafile, $data)
  229. {
  230. $fh = fopen($namafile, "a");
  231. fwrite($fh, $data);
  232. fclose($fh);
  233. }
  234. }
  235.  
  236. $modules = new modules();
  237. $marlboro = new marlboro();
  238.  
  239. //print $marlboro->login("kaowkawok@gmail.com", "npwilgans@");
  240. //print $marlboro->view("how-to-rock-suit-with-sneakers");
  241.  
  242. awal:
  243. echo "Input FIle Akun Marlboro (Email|Pass) : ";
  244. $fileakun = trim(fgets(STDIN));
  245.  
  246. if(empty(@file_get_contents($fileakun)))
  247. {
  248. print PHP_EOL."File Akun not Found.. Silahkan Input Ulang".PHP_EOL;
  249. goto awal;
  250. }
  251.  
  252. print PHP_EOL."Total Ada : ".count(explode(PHP_EOL, @file_get_contents($fileakun)))." Akun ".PHP_EOL."Letsgo..";
  253.  
  254. while(true)
  255. {
  256. $time = date("Y-m-d H:i:s");
  257. echo PHP_EOL."Start : ".$time;
  258. foreach(@explode("\n", str_replace("\r", "", @file_get_contents($fileakun))) as $c => $akon)
  259. {
  260. $date = date("Y-m-d H:i:s");
  261. $email = explode("|", trim($akon))[0];
  262. $password = explode("|", trim($akon))[1];
  263. echo PHP_EOL.PHP_EOL."Ekse Akun : ".$email.PHP_EOL;
  264. $marlboro->execute_login($email, $password);
  265. $marlboro->execute_nonton($email);
  266. }
  267.  
  268. echo PHP_EOL.PHP_EOL."Sleep Time : ".$date;
  269. print PHP_EOL."All Done Run!, Sleep 24 Hours";
  270. print PHP_EOL."Start Besok : ".date('Y-m-d H:i:s', time() + (60 * 60 * 24));
  271. sleep(86400);
  272. }
  273.  
  274. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement