PageRenderTime 71ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/hosts/rapidshare_de.php

https://github.com/gartz/RapidLeetch
PHP | 139 lines | 116 code | 23 blank | 0 comment | 21 complexity | 9371061a36699060fb4ec49b88d79c1d MD5 | raw file
  1. <?php
  2. if (!defined('RAPIDLEECH'))
  3. {
  4. require_once("index.html");
  5. exit;
  6. }
  7. if (($_GET["premium_acc"] == "on" && $_GET["premium_user"] && $_GET["premium_pass"]) || ($_GET["premium_acc"] == "on" && $premium_acc["rs_de"]["user"] && $$premium_acc["rs_de"]["pass"]))
  8. {
  9. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
  10. is_page($page);
  11. is_present($page,"File not found");
  12. is_present($page,"This file has been deleted");
  13. is_present($page,"Inactivity-timeout exceeded");
  14. is_present($page,"unavailable due to technical-maintenance", "Download-Server unavailable due to maintenance");
  15. is_present($page,"unavailable due to hardware-problems", "Server unavailable due to hardware-problems");
  16. $FileName = basename(trim(cut_str($page, 'name="uri" value="', '"')));
  17. !$FileName ? $FileName = basename($Url["path"]) : "";
  18. $auth = $_GET["premium_user"] ? base64_encode($_GET["premium_user"].":".$_GET["premium_pass"]) : base64_encode($premium_acc["rs_de"]["user"].":".$premium_acc["rs_de"]["pass"]);
  19. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth, $auth);
  20. is_page($page);
  21. if (stristr($page,"Location:"))
  22. {
  23. $Href = trim(cut_str($page,"Location:","\n"));
  24. $Url = parse_url($Href);
  25. 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" : ""));
  26. }
  27. else
  28. {
  29. html_error("Cannot use premium account");
  30. }
  31. }
  32. else
  33. {
  34. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
  35. is_page($page);
  36. is_present($page,"File not found");
  37. is_present($page,"This file has been deleted");
  38. is_present($page,"Inactivity-timeout exceeded");
  39. is_present($page,"unavailable due to technical-maintenance", "Download-Server unavailable due to maintenance");
  40. is_present($page,"unavailable due to hardware-problems", "Server unavailable due to hardware-problems");
  41. $post = array();
  42. $post["uri"] = $Url["path"];
  43. $post["dl.start"] = "Free";
  44. $Href = trim(cut_str($page, '<form action="', '"'));
  45. $Url = parse_url($Href);
  46. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : "") ,$LINK , 0, $post, 0, $_GET["proxy"],$pauth);
  47. is_page($page);
  48. is_present($page, "is not allowed to use the free-service anymore today","No more free downloads from this IP today");
  49. is_present($page, "This file exceeds your download-limit","Download limit exceeded");
  50. is_present($page, "KB in one hour","Download limit exceeded");
  51. is_present($page, "is already downloading a file","Your IP-address is already downloading a file");
  52. if (stristr($page, "Want to download more?"))
  53. {
  54. $minutes = trim(cut_str($page, "Or wait", "minute"));
  55. if ($minutes)
  56. {
  57. html_error("Download limit exceeded. You have to wait ".$minutes." minutes until the next download.");
  58. }
  59. else
  60. {
  61. html_error("Download limit exceeded.");
  62. }
  63. }
  64. if(stristr($page, "Too many users downloading right now") || stristr($page, "Too many connections"))
  65. {
  66. html_error("Too many users are downloading right now");
  67. }
  68. $countDown = trim(cut_str($page, "var c =", ";"));
  69. $code = urldecode(cut_str($page, "unescape('", "'"));
  70. if (!$code)
  71. {
  72. html_error('Error getting access code');
  73. }
  74. $access_image_url = trim(cut_str($code,'<img src="','">'));
  75. if (!$access_image_url)
  76. {
  77. html_error('Error getting access image url');
  78. }
  79. if ($images_via_php === true)
  80. {
  81. $code = str_replace($access_image_url, $PHP_SELF."?image=".urlencode(trim(cut_str($code, '<img src="', '">')))."&referer=".urlencode($Url["scheme"]."://".$Url["host"]."/"), $code);
  82. }
  83. $FileAddr = trim(cut_str($code, '<form name="dl" action="', '"'));
  84. $Href = parse_url($FileAddr);
  85. $FileName = basename($Href["path"]);
  86. if (!$FileAddr)
  87. {
  88. html_error("Error getting download link");
  89. }
  90. $code = str_replace($FileAddr, $PHP_SELF.(isset($_GET["audl"]) ? "?audl=doum" : ""), $code);
  91. $capthatag = cut_str($code,'here: <input','>');
  92. $capthatag = cut_str($capthatag,'name="','"');
  93. preg_match_all("/http:\/\/dl(.*).rapidshare.de\/(.*)".$FileName."/iU", $code, $matches);
  94. if (!$matches)
  95. {
  96. html_error("Error getting available server's list");
  97. }
  98. for ($i = 0; $i < count($matches[0]); $i++)
  99. {
  100. $Url = parse_url($matches[0][$i]);
  101. $code = str_replace("document.dl.action='".$matches[0][$i], "document.dl.host.value='".$Url["host"], $code);
  102. }
  103. $code = str_replace("</form>", $nn, $code);
  104. $code.= "<input type=\"hidden\" name=\"filename\" value=\"".urlencode($FileName)."\">$nn<input type=\"hidden\" name=\"link\" value=\"".urlencode($LINK)."\">$nn<input type=\"hidden\" name=\"referer\" value=\"".urlencode($Referer)."\">$nn<input type=\"hidden\" name=\"saveto\" value=\"".$_GET["path"]."\">$nn<input type=\"hidden\" name=\"host\" value=\"".$Href["host"]."\">$nn<input type=\"hidden\" name=\"path\" value=\"".urlencode($Href["path"])."\">$nn";
  105. $code.= ($_GET["add_comment"] == "on" ? "<input type=\"hidden\" name=\"comment\" value=\"".urlencode($_GET["comment"])."\">$nn" : "")."<input type=\"hidden\" name=\"email\" value=\"".($_GET["domail"] ? $_GET["email"] : "")."\">$nn<input type=\"hidden\" name=\"partSize\" value=\"".($_GET["split"] ? $_GET["partSize"] : "")."\">$nn";
  106. $code.= "<input type=\"hidden\" name=\"method\" value=\"".$_GET["method"]."\">$nn<input type=\"hidden\" name=\"proxy\" value=\"".($_GET["useproxy"] ? $_GET["proxy"] : "")."\">$nn".($pauth ? "<input type=\"hidden\" name=\"pauth\" value=\"".$pauth."\">$nn" : "");
  107. $code.= "</form>";
  108. $code = str_replace('type="submit"', 'type="submit" onclick="return check()"', $code);
  109. $js_code = "<script language=\"JavaScript\">".$nn."function check() {".$nn."var imagecode=document.dl.$capthatag.value;".$nn."var path=document.dl.path.value;".$nn;
  110. $js_code.= 'if (imagecode == "") { window.alert("You didn\'t enter the image verification code"); return false; }'.$nn.'else {'.$nn.'document.dl.path.value=path+escape("?'.$capthatag.'="+imagecode);'.$nn.'return true; }'.$nn.'}'.$nn.'</script>'.$nn;
  111. insert_new_timer($countDown, rawurlencode($code), "Download-Ticket reserved.", $js_code);
  112. }
  113. ?>