PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/hosts/download/hotfile_com.php

https://github.com/gartz/RapidLeetch
PHP | 216 lines | 189 code | 10 blank | 17 comment | 39 complexity | 3798e68be32bab82bbfd90f742679722 MD5 | raw file
  1. <?php
  2. if (!defined('RAPIDLEECH'))
  3. {
  4. require_once("index.html");
  5. exit;
  6. }
  7. if (($_REQUEST["premium_acc"] == "on" && $_REQUEST["premium_user"] && $_REQUEST["premium_pass"]) || ($_REQUEST["premium_acc"] == "on" && $premium_acc["hotfile_com"]["user"] && $premium_acc["hotfile_com"]["pass"]))
  8. {
  9. // ////////////////////////////////////////////////////////// START PREMIUM /////////////////////////////////////////////////////////////
  10. $Url = parse_url($LINK);
  11. $post = array();
  12. $post["returnto"] = "/";
  13. $post["user"] = $_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc["hotfile_com"]["user"];
  14. $post["pass"] = $_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc["hotfile_com"]["pass"];
  15. $auth = base64_encode($post["user"] . ":" . $post["pass"]);
  16. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"], $Referer, 0, 0, 0, $_GET["proxy"], $pauth, $auth);
  17. // echo "<pre>";var_dump(nl2br(htmlentities($page)));echo "</pre>";exit;
  18. if (!preg_match('|ocation: (.+)\r\n|i', $page, $loca))
  19. {
  20. if (!preg_match('|(http://hotfile\.com/get/\d+/\w+/\w+/.+)"\s|', $page, $loca))
  21. {
  22. html_error('No direct link found, please check your account details are correct');
  23. }
  24. else $newlink = $loca[1];
  25. }
  26. else $newlink = $loca[1];
  27. $redir = trim($newlink);
  28. $Url = parse_url($redir);
  29. $FileName = basename($Url["path"]);
  30. $sendauth = ($_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"]) ? encrypt($auth) : 1;
  31. insert_location ("$PHP_SELF?filename=" . urlencode ($FileName) . "&force_name=" . urlencode($FileName) . "&host=" . $Url ["host"] . "&path=" . urlencode ($Url ["path"] . ($Url ["query"] ? "?" . $Url ["query"] : "")) . "&referer=" . urlencode ($Referer) . "&email=" . ($_GET ["domail"] ? $_GET ["email"] : "") . "&partSize=" . ($_GET ["split"] ? $_GET ["partSize"] : "") . "&proxy=" . ($_GET ["useproxy"] ? $_GET ["proxy"] : "") . "&saveto=" . $_GET ["path"] . "&link=" . urlencode ($LINK) . ($_GET ["add_comment"] == "on" ? "&comment=" . urlencode ($_GET ["comment"]) : "") . "&auth=$sendauth" . ($pauth ? "&pauth=$pauth" : "") . (isset($_GET["audl"]) ? "&audl=doum" : ""));
  32. // ////////////////////////////////////////////////////////// END PREMIUM ///////////////////////////////////////////////////////////////
  33. }
  34. else
  35. {
  36. $hf = $_POST['hf'];
  37. if ($hf == "ok")
  38. {
  39. @unlink(urldecode($_POST["delete"]));
  40. $post = unserialize(urldecode($_POST['post']));
  41. $post["action"] = "checkcaptcha";
  42. $post["recaptcha_response_field"] = $_POST["captcha"];
  43. $Referer = $_POST["link"];
  44. $Url = parse_url($Referer);
  45. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), $Referer, $cookie, $post, 0, $_GET["proxy"], $pauth);
  46. is_page($page);
  47. preg_match('/\/\d+\/\w+\/\w+\/[^\'"]+/i', $page, $down);
  48. $LINK = "http://hotfile.com/get" . $down[0];
  49. if ($down[0] == "")
  50. {
  51. $dsource = cut_str($page, '<h3', '</h3');
  52. $ddw = cut_str($dsource, 'href="', '"');
  53. $LINK = $ddw;
  54. }
  55. if (!stristr($page, "REGULAR DOWNLOAD"))
  56. {
  57. $Url = parse_url($LINK);
  58. $FileName = basename($Url["path"]);
  59. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"], $Referer, 0, 0, 0, $_GET["proxy"], $pauth);
  60. preg_match('/Location: *(.+)/', $page, $redir);
  61. if (strpos($redir[1], "http://") === false)
  62. {
  63. html_error("Server problem. Please try again after", 0);
  64. }
  65. $redirect = rtrim($redir[1]);
  66. $Url = parse_url($redirect);
  67. insert_location("$PHP_SELF?filename=" . urlencode($FileName) . "&host=" . $Url["host"] . "&path=" . urlencode($Url["path"] . ($Url["query"] ? "?" . $Url["query"] : "")) . "&referer=" . urlencode($Referer) . "&email=" . ($_GET["domail"] ? $_GET["email"] : "") . "&partSize=" . ($_GET["split"] ? $_GET["partSize"] : "") . "&method=" . $_GET["method"] . "&proxy=" . ($_GET["useproxy"] ? $_GET["proxy"] : "") . "&saveto=" . $_GET["path"] . "&link=" . urlencode($LINK) . ($_GET["add_comment"] == "on" ? "&comment=" . urlencode($_GET["comment"]) : "") . "&auth=" . $auth . ($pauth ? "&pauth=$pauth" : "") . (isset($_GET["audl"]) ? "&audl=doum" : ""));
  68. exit;
  69. }
  70. }
  71. if ($hf == "ok")
  72. {
  73. echo ("<center><font color=red><b>Wrong captcha .Please re-enter</b></font></center>");
  74. }
  75. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"], $Referer, 0, 0, 0, $_GET["proxy"], $pauth);
  76. is_present($page, "File not found", "File not found, the file is not present or bad link", "0");
  77. is_present($page, "due to copyright", "This file is either removed due to copyright claim or is deleted by the uploader.", "0");
  78. is_present($page, "You are currently downloading", "You are currently downloading. Only one connection with server allow for free users", "0");
  79. preg_match_all('/timerend=d\.getTime\(\)\+(\d+)/i', $page, $arraytime);
  80. $wtime = $arraytime[1][1] / 1000;
  81. if ($wtime > 0)
  82. {
  83. $dowait = true;
  84. ?>
  85. <p><center><div id="dl"><h4>ERROR: Please enable JavaScript.</h4></div></center></p>
  86. <form action="index.php" method="post">
  87. <input type="hidden" name="link" value="<?php echo $LINK; ?>">
  88. <script language="JavaScript">
  89. var c = <?php echo $wtime; ?>;
  90. fc();
  91. function fc() {
  92. if(c>0) {
  93. document.getElementById("dl").innerHTML = "You reached your hourly traffic limit. Please wait <b>" + c + "</b> seconds...";
  94. c = c - 1;
  95. setTimeout("fc()", 1000);
  96. }
  97. else {
  98. document.getElementById("dl").style.display="none";
  99. void(document.forms[0].submit());
  100. }
  101. }
  102. </script>
  103. </form></body></html>
  104. <?php
  105. exit;
  106. }
  107. $action = cut_str($page, "action value=", ">");
  108. $tm = cut_str($page, "tm value=", ">");
  109. $tmhash = cut_str($page, "tmhash value=", ">");
  110. $wait = cut_str($page, "wait value=", ">");
  111. $waithash = cut_str($page, "waithash value=", ">");
  112. $post = array();
  113. $post["action"] = $action;
  114. $post["tm"] = $tm;
  115. $post["tmhash"] = $tmhash;
  116. $post["wait"] = $wait;
  117. $post["waithash"] = $waithash;
  118. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"], $Referer, 0, $post, 0, $_GET["proxy"],$pauth);
  119. preg_match('/\/\d+\/\w+\/\w+\/[^\'"]+/i', $page, $down);
  120. $LINK="http://hotfile.com/get".$down[0];
  121. if ($down[0] == "")
  122. {
  123. $dsource = cut_str($page, '<h3', '</h3');
  124. $ddw = cut_str($dsource, 'href="', '"');
  125. $LINK = $ddw;
  126. }
  127. if ($down[0] == "")
  128. {
  129. $nofinish = true;
  130. $Url = parse_url("http://api.recaptcha.net/noscript?k=6LfRJwkAAAAAAGmA3mAiAcAsRsWvfkBijaZWEvkD");
  131. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), $Referer, 0, 0, 0, $_GET["proxy"], $pauth);
  132. is_page($page);
  133. is_present($page, "Expired session", "Expired session . Go to main page and reattempt", 0);
  134. if(preg_match('/Location: *(.+)/i', $page, $redir ))
  135. {
  136. $newreca = trim( $redir[1] );
  137. $Url = parse_url( $newreca );
  138. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"], $pauth);
  139. is_page($page);
  140. $ch = cut_str ( $page ,'src="image?c=' ,'"' );
  141. }
  142. if($ch)
  143. {
  144. $Url=parse_url("http://www.google.com/recaptcha/api/image?c=".$ch);
  145. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  146. $headerend = strpos($page,"\r\n\r\n");
  147. $pass_img = substr($page,$headerend+4);
  148. $imgfile = $options['download_dir']."hotfile_captcha.jpg";
  149. if (file_exists($imgfile)){ unlink($imgfile);
  150. }
  151. write_file($imgfile, $pass_img);
  152. }
  153. else
  154. {
  155. html_error("Error get captcha", 0);
  156. }
  157. unset($post);
  158. $post['recaptcha_challenge_field']=$ch;
  159. $code = '<center>';
  160. $code.= "<form method=\"post\" action=\"".$PHP_SELF.(isset($_GET["audl"]) ? "?audl=doum" : "")."\">$nn";
  161. $code.= "<h4>Type the two words:<br><img src=\"$imgfile\"> <br>here:<input name=\"captcha\" type=\"text\" >$nn";
  162. $code.= "<input name=\"link\" value=\"$Referer\" type=\"hidden\">$nn";
  163. $code.= '<input type="hidden" name="post" value="'.urlencode(serialize($post)).'">'.$nn;
  164. $code.= "<input name=\"hf\" value=\"ok\" type=\"hidden\">$nn";
  165. $code.= "<br><input name=\"Submit\" value=\"Submit\" type=\"submit\"></h4>";
  166. $code.= "</form></center>";
  167. $js_code = "".$nn;
  168. if (!$wait)
  169. {
  170. print $code.$nn.$nn.$js_code."$nn</body>$nn</html>";
  171. }
  172. else
  173. {
  174. insert_new_timer($wait, rawurlencode($code), "You will download as a Free User.", $js_code);
  175. }
  176. }
  177. if (!$nofinish)
  178. {
  179. $Url = parse_url($LINK);
  180. $FileName = basename($Url["path"]);
  181. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"], $Referer, 0, 0, 0, $_GET["proxy"], $pauth);
  182. preg_match('/Location: *(.+)/i', $page, $redir);
  183. if (strpos($redir[1], "http://") === false)
  184. {
  185. html_error("Server problem. Please try again after", 0);
  186. }
  187. $redirect = rtrim($redir[1]);
  188. $Url = parse_url($redirect);
  189. insert_location("$PHP_SELF?filename=" . urlencode($FileName) . "&host=" . $Url["host"] . "&path=" . urlencode($Url["path"] . ($Url["query"] ? "?" . $Url["query"] : "")) . "&referer=" . urlencode($Referer) . "&email=" . ($_GET["domail"] ? $_GET["email"] : "") . "&partSize=" . ($_GET["split"] ? $_GET["partSize"] : "") . "&method=" . $_GET["method"] . "&proxy=" . ($_GET["useproxy"] ? $_GET["proxy"] : "") . "&saveto=" . $_GET["path"] . "&link=" . urlencode($LINK) . ($_GET["add_comment"] == "on" ? "&comment=" . urlencode($_GET["comment"]) : "") . "&auth=" . $auth . ($pauth ? "&pauth=$pauth" : "") . (isset($_GET["audl"]) ? "&audl=doum" : ""));
  190. }
  191. }
  192. /**
  193. * ***************************\
  194. * WRITTEN by kaox 15-oct-2009
  195. * UPDATE by kaox 01-mar-2010
  196. * \***************************
  197. */
  198. //updated 05-jun-2010 for standard auth system (szal)
  199. /**
  200. * ***************************
  201. * Code for free users got from omarkh..
  202. * code modded by Raaju into old code of svn322...
  203. * code verified on 21/12/2010 by Raaju.....
  204. * \***************************
  205. */
  206. ?>