PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/hosts/megaupload_com.php

https://github.com/gartz/RapidLeetch
PHP | 169 lines | 167 code | 2 blank | 0 comment | 3 complexity | cad5e800512e87ad22fa5ea011a87e1c MD5 | raw file
  1. <?php
  2. if (! defined ( 'RAPIDLEECH' )) {
  3. require_once ("index.html");
  4. exit ();
  5. }
  6. class megaupload_com extends DownloadClass {
  7. public function Download($link) {
  8. global $premium_acc,$mu_cookie_user_value;
  9. $matches = "";
  10. $Url = parse_url(trim($link));
  11. if (preg_match ( "/f=(\w+)/", $Url ["query"], $matches )) {
  12. $page = $this->GetPage("http://www.megaupload.com/xml/folderfiles.php?folderid=" . $matches [1]);
  13. if (! preg_match_all ( "/url=\"(http[^\"]+)\"/", $page, $matches )) html_error ( 'link not found' );
  14. if (! is_file ( "audl.php" )) html_error ( 'audl.php not found' );
  15. echo "<form action=\"audl.php?GO=GO\" method=post>\n";
  16. echo "<input type=hidden name=links value='" . implode ( "\r\n", $matches [1] ) . "'>\n";
  17. foreach ( array ( "useproxy", "proxy", "proxyuser", "proxypass" ) as $v )
  18. echo "<input type=hidden name=$v value=" . $_GET [$v] . ">\n";
  19. echo "<script language=\"JavaScript\">void(document.forms[0].submit());</script>\n</form>\n";
  20. flush ();
  21. exit ();
  22. }
  23. if ( ($_REQUEST ["premium_acc"] == "on" && $_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"]) ||
  24. ($_REQUEST ["premium_acc"] == "on" && $premium_acc ["megaupload_com"] ["user"] && $premium_acc ["megaupload_com"] ["pass"] ) ||
  25. ($mu_cookie_user_value))
  26. {
  27. $this->DownloadPremium($link);
  28. }else
  29. if( $_POST['pass_pre'] == "ok") {
  30. global $Referer;
  31. $post ["filepassword"] = $_POST ['password'];
  32. $cookie=$_POST['cookie'];
  33. $page = $this->GetPage($link, $cookie, $post, $Referer );
  34. if (stristr($page,'password protected'))
  35. {
  36. echo ("<center><font color=red><b>Wrong password .Please re-enter</b></font></center>");
  37. $this->DownloadPremium($link);exit;
  38. }
  39. is_page($page);
  40. if (stristr ( $page, "Location:" )) {
  41. $Href = trim ( cut_str ( $page, "Location: ", "\n" ) );
  42. $Url = parse_url ( html_entity_decode($Href, ENT_QUOTES, 'UTF-8') );
  43. $FileName = basename ( $Url ["path"] );
  44. $this->RedirectDownload($Href,$FileName,encrypt($premium_cookie));exit;
  45. }
  46. } else {
  47. if( $_POST['pass_free'] == "ok") {
  48. global $Referer;
  49. $post ["filepassword"] = $_POST ['password'];
  50. $page = $this->GetPage($link, 0, $post, $Referer );
  51. is_page($page);
  52. if (stristr($page,'password protected')) {
  53. echo ("<center><font color=red><b>Wrong password .Please re-enter</b></font></center>");
  54. $this->DownloadFree($link);
  55. exit;
  56. }
  57. $countDown = trim ( cut_str ( $page, "count=",";" ) );
  58. insert_timer( $countDown, "<b>Megaupload Free User</b>.","",true );
  59. if (preg_match('/http:\/\/(.*)" class="down_butt1"/', $page, $match)) {
  60. $Href = "http://$match[1]";
  61. $Url = parse_url ( html_entity_decode($Href, ENT_QUOTES, 'UTF-8') );
  62. if (! is_array ( $Url )) {
  63. html_error ( "Download link not found", 0 );
  64. }
  65. $FileName = basename ( $Url ["path"] );
  66. $this->RedirectDownload($Href,$FileName);exit;
  67. }
  68. } else {
  69. $this->DownloadFree($link);
  70. }
  71. }
  72. }
  73. private function DownloadFree($link) {
  74. $Referer;
  75. $page = $this->GetPage($link,0,0,$Referer);
  76. is_page($page);
  77. if (stristr($page,'password protected')) {
  78. ?>
  79. <form method="post">
  80. <div>The file Megaupload you're trying to download is password protected. Please enter the password to proceed.</div>
  81. <input type="hidden" name="link" value="<?php echo $link; ?>" />
  82. <input type="hidden" name="pass_free" value="ok" />
  83. <input type="text" name="password" id="password"/><input type="submit" value="Proceed" />
  84. </form>
  85. <?php
  86. exit;
  87. }
  88. //$countDown = trim ( cut_str ( $page, "count=",";" ) );
  89. //insert_timer( $countDown, "<b>Megaupload Free User</b>.","",true );
  90. //
  91. //Don't edit this random $countDown to 0.
  92. $countDown = rand(5, 10);
  93. sleep($countDown);
  94. is_present ( $page, "The file you are trying to access is temporarily unavailable" );
  95. preg_match('/http:\/\/(.*)" class="down_butt1"/', $page, $match);
  96. if (isset($match[1])) {
  97. $Href = 'http://'.$match[1];
  98. $Url = parse_url ( html_entity_decode($Href, ENT_QUOTES, 'UTF-8') );
  99. if (! is_array ( $Url )) {
  100. html_error ( "Download link not found", 0 );
  101. }
  102. $FileName = basename ( $Url ["path"] );
  103. $this->RedirectDownload($Href,$FileName);
  104. exit ();
  105. }
  106. }
  107. private function DownloadPremium($link) {
  108. global $Referer, $premium_acc, $mu_cookie_user_value;
  109. $post = array ();
  110. $post ['login'] = 1;
  111. $post ["username"] = $_GET ["premium_user"] ? $_GET ["premium_user"] : $premium_acc ["megaupload_com"] ["user"];
  112. $post ["password"] = $_GET ["premium_pass"] ? $_GET ["premium_pass"] : $premium_acc ["megaupload_com"] ["pass"];
  113. $page = $this->GetPage('http://www.megaupload.com/?c=login',0,$post,'http://www.megaupload.com');
  114. is_page($page);
  115. $premium_cookie = GetCookies($page);
  116. if ($mu_cookie_user_value) {
  117. $premium_cookie = 'user=' . $mu_cookie_user_value;
  118. } elseif ($_GET ["mu_acc"] == "on" && $_GET ["mu_cookie"]) {
  119. $premium_cookie = 'user=' . $_GET ["mu_cookie"];
  120. } elseif (! stristr ( $premium_cookie, "user" )) {
  121. html_error ( "Cannot use premium account", 0 );
  122. }
  123. $page = $this->GetPage($link,$premium_cookie,0,$Referer);
  124. is_page ( $page );
  125. if (stristr($page,'password protected')) {
  126. ?>
  127. <form method="post">
  128. <div>The file Megaupload you're trying to download is password protected. Please enter the password to proceed.</div>
  129. <input type="hidden" name="link" value="<?php echo $link; ?>" />
  130. <input type="hidden" name="cookie" value="<?php echo $premium_cookie;?>" />
  131. <input type="hidden" name="pass_pre" value="ok" />
  132. <input type="text" name="password" id="password"/><input type="submit" value="Proceed" />
  133. </form>
  134. <?php
  135. exit;
  136. }
  137. if (stristr ( $page, "Location:" )) {
  138. $Href = trim ( cut_str ( $page, "Location: ", "\n" ) );
  139. $Url = parse_url ( html_entity_decode($Href, ENT_QUOTES, 'UTF-8') );
  140. $FileName = basename ( $Url ["path"] );
  141. $this->RedirectDownload($Href,$FileName,encrypt($premium_cookie));
  142. } elseif ($page = cut_str ( $page, 'class="down_ad_pad1">', '" class="down_ad_butt1"' )) {
  143. $Href = cut_str ( $page, 'href="', '"' );
  144. $Referer = $link;
  145. $Url = parse_url ( html_entity_decode($Href, ENT_QUOTES, 'UTF-8') );
  146. $FileName = basename ( $Url ["path"] );
  147. $this->RedirectDownload($Href,$FileName,encrypt($premium_cookie));
  148. } else {
  149. html_error ( "Download link not found", 0 );
  150. }
  151. }
  152. }
  153. // Updated by rajmalhotra on 10 Jan 2010 MegaUpload captcha is downloaded on server, then display
  154. // Fixed by rajmalhotra on 20 Jan 2010 Fixed for Download link not found in happy hour
  155. // Fixed by VinhNhaTrang 13.10.2010
  156. // Fixed by VinhNhaTrang 30.11.2010
  157. // Fixed by thangbom40000 on 2010.12.1, Fix for free user and premium download, no wait time, no capcha with free user.
  158. // Fixed by thangbom40000 on 2010.12.2, Fix premium account can't login.
  159. ?>