Although the web is full of scripts to help downloading from rapidshare with a premium account, none of them seemed to work for me. First, create a cookie file: curl -k -c .rapidshare -d 'login=USERID&password=PASSWORD' 'https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi'. In the browser first you click the "premium user" button, second you click "download". We download these pages because the first contains the number of the rapidshare server actually containing the file, like rs123.rapidshare.com and then the mirror like rs123gc3 for Global Crossing.
<?php
define ('COOKIEFILE', '.rapidshare');
$url = $argv[1];
if (!$url) {echo "One argument needed\n";exit;}
$parts = parse_url($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$step1 = curl_exec($ch);
preg_match('|"(http://rs\d+[^"]+)"|', $step1, $match);
$url = $match[1];
$rs = preg_quote('.rapidshare.com');
// Create a preg based on the URL.
$mirror_mask = str_replace(preg_quote($url), $rs, 'action=\'([^.]+' . $rs) .'[^\']+)\'';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'dl.start=PREMIUM&submit=Premium%20user');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_COOKIEFILE, COOKIEFILE);
$step2 = curl_exec($ch);
preg_match("/$mirror_mask/", $step2, $masks);
$fh = fopen(basename($parts['path']), 'wb');
// It might not be necessary to re-init curl. But it certainly does not hurt.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $masks[1]);
curl_setopt($ch, CURLOPT_COOKIEFILE, COOKIEFILE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, FALSE);
curl_setopt($ch, CURLOPT_FILE, $fh);
curl_exec($ch);
fclose($fh);
?>


![Popular open source software is more secure than unpopular open source software, because insecure software becomes unpopular fast. [That doesn't happen for proprietary software.]](/sites/all/themes/drupal4hu/images/bg-center/bg-center_4.png)















12
Rapidshare premium account can be used properly if the cookie file is created properly and then by clicking on the download option download becomes easy. The download script described above is the easy step for creating premium account and downloading.
Zebra - Writes about People Search.
How is this even possible tho?
low carb diet nice
I am really appreciate to read this nice article,Here the security maintainable capacity is only for premium user but those are downloading by the free from the rapid share site they have to create a cookie file.
jeff johnson traffic voodoo
The script seems innovative and useful too.I do agree that browsing and downloading with any ordinary script is not much helpful to the users so this script will definitely bring a revolution in the field of web browsing.
Alice- Blogs about sell scrap gold
It makes the rapidshare user happy that they can now download their favorite file through rapidshare premium account. But for that we have to make the correct cookies for it and after that downloading would be an easy step for all users.
John - Writes about Rolex submariner watches for sale