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