Jump to content

cUrl + MegaUpload


Recommended Posts

Boas, estou a tentar desenvolver um código onde, utilizando uma conta premium do MegaUpload, ele disponiblize o link premium introduzindo apenas o link "normal",

até ao momento tenho isto da seguinte forma:

$conexao = mysql_connect("localhost", "base_De_dados", "password_aqui");
$db = mysql_select_db("****");


     $file_id = mysql_real_escape_string($_GET['id']);    
     $result = @mysql_query("SELECT link FROM tabela_links WHERE id = '$file_id'"); 
     $red = @mysql_fetch_array($result);   

  $login = "username_aqui";
$password = "pass**_aqui";
        $post = 'login='.$login.'&password='.$password.'&loginform'; 
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
$cookies = "cookies.txt";
$url = $red[0];

$ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
    curl_setopt($ch, CURLOPT_POST, 1); 
    curl_setopt($ch, CURLOPT_POSTFIELDS,$post); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
    $result = curl_exec ($ch);
    curl_close ($ch); 

$link = explode('document.getElementById("downloadhtml").innerHTML = (', $result);
$link = explode("')", $link[1]);

header("Location: ".$link[0]);
} else {

É de referir 2 coisas, 1º todos os campos estão preenchidos, nomeadamente username's, password's, e base de dados, 2º a base de dados está criada, possuí um registo, com os seguintes campos : "id" e "link", com os seguintes valores : "12" "www.megaupload.com/pt/?d=T8J5768"


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.