var c = '))
{
$countDown = cut_str($page, "\n";
echo "\n\n";
$_GET["path"] = base64_decode(urldecode($_GET["path"]));
if (strstr($_GET["orlink"],'megaupload.com') || strstr($_GET["orlink"],'megarotic.com'))
{
$agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.7.12; Alexa Toolbar; MEGAUPLOAD 1.0) Gecko/20050919 Firefox/1.0.7";
}
$_GET["host"] = base64_decode(urldecode($_GET["host"]));
$_GET["FileName"] = base64_decode(urldecode($_GET["FileName"]));
$cookies= ($_GET["cookie"]) ? unserialize(base64_decode(urldecode($_GET["cookie"]))) : 0;
$pauth=urldecode($_GET["pauth"]);
if($_GET["auth"])
{
$AUTH["use"] = TRUE;
$AUTH["str"] = $_GET["auth"];
}
else
{
unset($AUTH);
}
$postquery = ($_GET["post"]) ? unserialize(base64_decode(urldecode(trim($_GET["post"])))) : 0;
do
{
list($_GET["FileName"],$tmp) = explode('?',urldecode(trim($_GET["FileName"])));
$_GET["path"] = trim($_GET["path"]);
$_GET["referer"] = trim($_GET["referer"]);
$_GET["link"] = trim($_GET["link"]);
$redirectto="";
$ftp = parse_url($_GET["link"]);
$IS_FTP = $ftp["scheme"] == "ftp" ? TRUE : FALSE;
$AUTH["ftp"] = array(
"login" => $ftp["user"] ? $ftp["user"] : "anonymous",
"password" => $ftp["pass"] ? $ftp["pass"] : "anonymous@list.ru"
);
$pathWithName = $_GET["saveto"].PATH_SPLITTER.$_GET["FileName"];
list($pathWithName,$tmp) = explode('?',$pathWithName);
switch ($ftp["scheme"])
{
case "ftp":
$defport=21;
break;
case "http":
$defport=80;
break;
case "https":
if (!$ssl_support) html_error('This protocol ['.$ftp["scheme"].'] not supported via current host');
if ($_GET["proxy"]) html_error('This protocol ['.$ftp["scheme"].'] not supported via PROXY');
$defport=443;
break;
default:
html_error('Unknown protocol ['.$ftp["scheme"].']');
break;
}
$ports=$ftp["port"] ? $ftp["port"] : $defport;
if ($_GET["proxy"])
{
echo "Connected to proxy : ".$_GET["proxy"]."...
\n";
echo "GET : ".$_GET["link"]."...
\n";
}
else
{
echo "
Connected To : ".$ftp[host].":$ports...
";
}
switch ($ftp["scheme"])
{
case "ftp":
if (!$_GET["proxy"])
{
$file = getftpurl($_GET["host"],$ports , $_GET[path], $pathWithName);
}
else
{
$file = geturl($_GET["host"], $ports, $_GET[path], $_GET[referer], $cookies, $postquery, $pathWithName, $_GET["proxy"],$pauth,$ftp["scheme"]);
}
break;
case "http":
case "https":
$file = geturl($_GET["host"], $ports, $_GET[path], $_GET[referer], $cookies, $postquery, $pathWithName, $_GET["proxy"],$pauth,$ftp["scheme"]);
break;
}
if($redir && $lastError && strstr($lastError,"it is redirected to ["))
{
$redirectto=trim(cut_str($lastError,"it is redirected to [","]"));
echo "Redirecting to: $redirectto ...
";
$cookies=GetCookies($file);
$redirectto = ($redirectto[0] == '.' && $redirectto[1] == '/') ? $ftp["scheme"]."://".$ftp["host"].dirname($ftp["path"]).substr($redirectto,1) : $redirectto;
$redirectto = $redirectto[0] == '/' ? $ftp["scheme"]."://".$ftp["host"].$redirectto : $redirectto;
$_GET["link"]=$redirectto;
$purl=parse_url($redirectto);
list($_GET["FileName"],$tmp) = explode('?',basename($redirectto));
$_GET["path"] = $purl["path"].($purl["query"] ? "?".$purl["query"] : "");
$_GET["host"] = $purl["host"];
$auth=($purl["user"] & $purl["pass"]) ? base64_encode($purl["user"].":".$purl["pass"]) : "";
if ($auth)
{
$AUTH["use"]=TRUE;
$AUTH["str"]=$auth;
}
else
{
unset($AUTH);
}
$postquery=0;
$lastError="";
}
} while ($redirectto && !$lastError);
if ($lastError)
{
echo $lastError;
}
elseif (($file[bytesReceived] == $file[bytesTotal]) or (($file[bytesReceived] > 0) && !$file[bytesTotal]))
{
$inCurrDir = strstr(dirname($pathWithName), getcwd()) ? TRUE : FALSE;
if($inCurrDir)
{
$Path = 'http://'.$_SERVER["HTTP_HOST"].(dirname($PHP_SELF) == "/" ? "" : dirname($PHP_SELF)).substr(dirname($pathWithName), strlen(getcwd()));
}
echo "\r\n";
echo "File ".($inCurrDir ? "" : "").basename($file["file"]).($inCurrDir ? "" : "")." (".$file[size].") Saved!
Time: ".$file[time]."
Average Speed: ".$file[speed]." KB/s
";
if(!write_file($workpath.PATH_SPLITTER."files.lst", serialize(array("name" => $file["file"], "size" => $file["size"], "date" => time(), "link" => $_GET["orlink"], "comment" => str_replace("\n", "\\n", str_replace("\r", "\\r", $_GET["comment"]))))."\r\n", 0))
{
echo "Couldn't update the files list
";
}
if($_GET["email"])
{
echo "
\n";
$_GET[partSize] = (isset($_GET[partSize]) ? $_GET[partSize] * 1024 * 1024 : FALSE);
if (xmail($fromaddr, $_GET["email"], "File ".basename($file["file"]), "File: ".basename($file["file"])."\r\n"."Link: ".$_GET["orlink"].($_GET["comment"]? "\r\n"."Comments: ".str_replace("\\r\\n", "\r\n", $_GET["comment"]) : ""), $file["file"], $_GET["partSize"], $_GET["method"]))
{
echo "\r\n";
}
else
{
echo "\r\n";
}
}
echo "
Go Back to Main!";
}
?>