PageRenderTime 23ms CodeModel.GetById 12ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/hosts/rapidshare_com.php

https://github.com/gartz/RapidLeetch
PHP | 136 lines | 120 code | 15 blank | 1 comment | 10 complexity | c1d119e1218bd546b3531dcd8a447e15 MD5 | raw file
  1<?php
  2if (!defined('RAPIDLEECH'))
  3{
  4	require_once("index.html");
  5	exit;
  6}
  7
  8if (($_REQUEST["premium_acc"] == "on" && $_REQUEST["premium_user"] && $_REQUEST["premium_pass"]) || ($_GET["premium_acc"] == "on" && $premium_acc["rs_com"]["user"] && $premium_acc["rs_com"]["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,"The file could not be found.", "The file could not be found. Please check the download link.");
 14	is_present($page,"This limit is reached", "This file is neither allocated to a Premium Account, or a Collector's Account, and can therefore only be downloaded 10 times. This limit is reached.");
 15	is_present($page,"Due to a violation of our terms of use, the file has been removed from the server.");
 16	is_present($page,"This file is suspected to contain illegal content and has been blocked.");
 17	is_present($page,"The uploader has removed this file from the server.");
 18	is_present($page,"This file has been removed from the server, because the file has not been accessed in a long time.");
 19	is_present($page,"is momentarily not available", "This server is momentarily not available.  We are aware of this and are working to get this resolved.");
 20	is_present($page,"unavailable due to hardware-problems", "Server unavailable due to hardware-problems");
 21
 22	$FileName = basename(trim(cut_str($page, '<form action="', '"')));
 23	!$FileName ? $FileName = basename($Url["path"]) : "";
 24	$auth = $_REQUEST["premium_user"] ? base64_encode($_REQUEST["premium_user"].":".$_REQUEST["premium_pass"]) : base64_encode($premium_acc["rs_com"]["user"].":".$premium_acc["rs_com"]["pass"]);
 25
 26	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth, $auth);
 27	is_page($page);
 28	is_present($page,"Account found, but password is incorrect");
 29	is_present($page,"Account not found");
 30
 31	if (stristr($page, "Location:"))
 32		{
 33		$Href = trim(cut_str($page, "Location:","\n"));
 34		$Url =  parse_url($Href);
 35
 36	 	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" : ""));
 37		}
 38	else
 39		{
 40		html_error("Cannot use premium account", 0);
 41		}
 42	}
 43else
 44	{
 45	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
 46	is_page($page);
 47
 48	is_present($page,"Due to a violation of our terms of use, the file has been removed from the server.");
 49	is_present($page,"This limit is reached", "This file is neither allocated to a Premium Account, or a Collector's Account, and can therefore only be downloaded 10 times. This limit is reached.");
 50	is_present($page,"This file is suspected to contain illegal content and has been blocked.");
 51	is_present($page,"The file could not be found.", "The file could not be found. Please check the download link.");
 52	is_present($page,"The uploader has removed this file from the server.");
 53	is_present($page,"This file has been removed from the server, because the file has not been accessed in a long time.");
 54	is_present($page,"is momentarily not available", "This server is momentarily not available.  We are aware of this and are working to get this resolved.");
 55	is_present($page,"unavailable due to hardware-problems", "Server unavailable due to hardware-problems");
 56	is_present($page, "is already downloading a file","Your IP-address is already downloading a file, Please wait until the download is completed.");
 57
 58	$post = array();
 59	$post["dl.start"] = "Free";
 60
 61	$Href = trim(cut_str($page, '<form action="', '"'));
 62	$refimg = $Href;
 63	$Url = parse_url($Href);
 64
 65	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : "") ,$LINK , 0, $post, 0, $_GET["proxy"],$pauth);
 66	is_page($page);
 67
 68	is_present($page, "is not allowed to use the free-service anymore today","No more free downloads from this IP today");
 69	is_present($page,"This limit is reached", "This file is neither allocated to a Premium Account, or a Collector's Account, and can therefore only be downloaded 10 times. This limit is reached.");
 70	is_present($page, "This file exceeds your download-limit","Download limit exceeded");
 71	is_present($page, "is already downloading a file","Your IP-address is already downloading a file, Please wait until the download is completed.");
 72
 73	if (stristr($page, "Would you like more?"))
 74		{
 75		$minutes = trim(cut_str($page, "Or try again in about ", "minutes"));
 76		if ($minutes)
 77			{
 78               $countdown2= $minutes*60;
 79			}
 80		else
 81			{
 82			html_error("Download limit exceeded.", 0);
 83			}
 84		}
 85
 86	if(stristr($page, "Too many users downloading right now") || stristr($page, "Too many connections"))
 87		{
 88		html_error("Too many users downloading right now", 0);
 89		}
 90
 91if($countdown2) {
 92
 93
 94 insert_timer($countdown2, "Plus Wait time for free user.");
 95
 96      $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
 97    is_page($page);
 98
 99    is_present($page,"Due to a violation of our terms of use, the file has been removed from the server.");
100    is_present($page,"This limit is reached", "This file is neither allocated to a Premium Account, or a Collector's Account, and can therefore only be downloaded 10 times. This limit is reached.");
101    is_present($page,"This file is suspected to contain illegal content and has been blocked.");
102    is_present($page,"The file could not be found.", "The file could not be found. Please check the download link.");
103    is_present($page,"The uploader has removed this file from the server.");
104    is_present($page,"This file has been removed from the server, because the file has not been accessed in a long time.");
105    is_present($page,"is momentarily not available", "This server is momentarily not available.  We are aware of this and are working to get this resolved.");
106    is_present($page,"unavailable due to hardware-problems", "Server unavailable due to hardware-problems");
107    is_present($page, "is already downloading a file","Your IP-address is already downloading a file, Please wait until the download is completed.");
108
109    $post = array();
110    $post["dl.start"] = "Free";
111
112    $Href = trim(cut_str($page, '<form action="', '"'));
113    $refimg = $Href;
114    $Url = parse_url($Href);
115
116    $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : "") ,$LINK , 0, $post, 0, $_GET["proxy"],$pauth);
117    is_page($page);
118
119}
120
121
122        $countDown = trim(cut_str($page, "var c=", ";"));
123
124	preg_match('%<form name="dlf?".*</form>%s', $page, $form_content);
125	$middle_str = str_replace("\\", "", preg_replace('/(\' *\+.*?(\r\n)*.*?\'|display:none;)/s', '', $form_content[0]));
126	$code = '<center>'.trim($middle_str);
127	$FileAddr = trim(cut_str($code, '<form name="dlf" action="', '"'));
128    $FileName = basename($FileAddr);
129	$Url = parse_url($FileAddr);
130
131insert_timer($countDown, "Download-Ticket reserved.");
132insert_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($Referer).($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "")."&auth=".$auth.($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
133
134	}
135	// edited by kaox
136?>