Untitled
By: a guest | Sep 14th, 2009 | Syntax:
PHP | Size: 1.95 KB | Hits: 341 | Expires: Never
<?
// invoke like http://example.com/rscp.php?f=http://rapidshare.com/files/12345678/wtfwarez.rar
// if enough kb left on premium account and the file exists, script will download file and pass thru.
// if not, script will break and display error.
$rsc_acc="1234567";
$rsc_pass="pass";
$file=$_GET["f"];
else
$r="@(http.?\:\/\/)?(.*)?rapidshare\.com\/files\/(.*)\/(.*)$@isU";
$fid=$hit[3];
$fn=$hit[4];
} else
$pa_stats=file("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login=$rsc_acc&password=$rsc_pass&withcookie=1");
foreach($pa_stats as $line) {
}
if( !($pa["premkbleft"]>0
) || !(strlen($pa["cookie"])>0
) )
die("can not access account data. report to author!");
else {
$kbleft=$pa["premkbleft"];
$cookie=$pa["cookie"];
}
$fstats=file("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles_v1&files=$fid&filenames=$fn");
$fs=$fstats[2]/1024; //convert to KB
if($fs>$kbleft)
die("premium account is empty or has not enough KB left (available: $kbleft KB, filesize $fs KB). wait 24 hrs or contact account owner.");
switch((int
)trim($fstats[4
])){
case 0:
case 4:
case 5:
die("file not available (deleted or locked)");
case 1:
case 2:
case 6:
$url="http://rs".$fstats[3].$fstats[5].".rapidshare.com/files/".$fstats[0]."/".$fstats[1]."";
break;
case 3:
die("rapidshare server down, retry later");
}
$user_agent = ini_get("user_agent");
ini_set("user_agent",$user_agent . "\r\nCookie: enc=$cookie");
$httphandle = fopen($url,"r");
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$fn.'"');
header('Content-Length: '.$fstats[2
]);
?>