Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: cURL logowanie rapidshare
Forum PHP.pl > Forum > PHP
masterek2009
Witam mam problem po ostatniej modyfikacji rapidshare nie da się zalogować a także wyciągnąć dane trafficleft itp. 

Cytat
$curl = curl_init();

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);

curl_setopt($curl, CURLOPT_HEADER, 1);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

curl_setopt($curl, CURLOPT_COOKIE, "user=$cook");

curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");

curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

curl_setopt($curl, CURLOPT_URL, "https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi");
//

curl_setopt($curl, CURLOPT_POST, 1);

//
$xxx = curl_exec($curl);



preg_match('#The Account has been found, but the password is incorrect#', $xxx, $l1);
if ($l1[0] == "The Account has been found, but the password is incorrect") {
return "incorrect";
}

preg_match('#This Account has been locked by our Abuse-Team#', $xxx, $l2);
if ($l2[0] == "This Account has been locked by our Abuse-Team") {
return "fraud";
}

preg_match('#Expiration date:</td><td style="padding-right:20px;"><b>[a-zA-Z0-9,. ]{1,}#', $xxx, $l3);
echo "<br>Wygasa: ".substr($l3[0], 56);
$validuntil = substr($l3[0], 56);

preg_match('#RapidPoints:</td><td align=right style="padding-right:20px;"><b>[0-9]{1,}#', $xxx, $l4);
echo "<br>RapidPoints: ".substr($l4[0], 61);
$points = substr($l4[0], 61);

preg_match('#Math.ceil\([0-9- ]{1,}#', $xxx, $l5);
echo "<br>Transfer: ".round(substr($l5[0], 10)/1000);
$tbw = round(substr($l5[0], 10)/1000);
echo "<br><hr><br>";
}
erix
Ok, a gdzie masz dane do logowania?
masterek2009
konto dodaje przez mój panel do bazy

Cały kod:

Cytat
<?php

function between($beg, $end, $str) {
$a = explode($beg, $str, 2);
$b = explode($end, $a[1]);
return $beg . $b[0] . $end;
}

 function get_value_from_code( $before, $after, $code)
 {
  $match = '#'.$before.'(.+?)'.$after.'#';
  if( preg_match( $match, $code, $match))
  {
  return $match[1];
  }
  return false;
 }
include "../db.php";
$conn=mysql_connect(mysql_host, mysql_user, mysql_password) or die(mysql_error());
mysql_select_db(mysql_db) or die("SQL Died");
function get_bw($cook){


$curl = curl_init();

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);

curl_setopt($curl, CURLOPT_HEADER, 1);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

curl_setopt($curl, CURLOPT_COOKIE, "user=$cook");

curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");

curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

curl_setopt($curl, CURLOPT_URL, "https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi");
//

curl_setopt($curl, CURLOPT_POST, 1);

//
$xxx = curl_exec($curl);

preg_match('#The Account has been found, but the password is incorrect#', $xxx, $l1);
if ($l1[0] == "The Account has been found, but the password is incorrect") {
return "incorrect";
}

preg_match('#This Account has been locked by our Abuse-Team#', $xxx, $l2);
if ($l2[0] == "This Account has been locked by our Abuse-Team") {
return "fraud";
}

preg_match('#Expiration date:</td><td style="padding-right:20px;"><b>[a-zA-Z0-9,. ]{1,}#', $xxx, $l3);
echo "<br>Wygasa: ".substr($l3[0], 56);
$validuntil = substr($l3[0], 56);

preg_match('#RapidPoints:</td><td align=right style="padding-right:20px;"><b>[0-9]{1,}#', $xxx, $l4);
echo "<br>RapidPoints: ".substr($l4[0], 61);
$points = substr($l4[0], 61);

preg_match('#Math.ceil\([0-9- ]{1,}#', $xxx, $l5);
echo "<br>Transfer: ".round(substr($l5[0], 10)/1000);
$tbw = round(substr($l5[0], 10)/1000);
echo "<br><hr><br>";
}

$today = date('dmy');
$bandw = 0;
$source = mysql_query("SELECT * FROM band")
or die(mysql_error());
$premnum = 0;
$totalbw = 0;

while($row = mysql_fetch_array( $source )) {
$premnum++;
$cook = $row['prem'];
$premid = $row['id'];
$type = $row['type'];
$result=get_bw($cook);
echo $cook;
echo " ";
echo $result;
/*$result = $bandwidth;
if($result == "expired" || $result == "bandwidth" || $result == "unknown" || $result=="incorrect")
{
 $status =
}
else
{
 $result= "";
 $status = 1;
}*/
/*mysql_query("update status set bandwidth='$result', type='$type' where AccountID='$premid'");
  $query="Update band set disabled = '$result' WHERE prem='$cook'";
 mysql_query($query) or die (mysql_error());*/
echo "<br />";
}
?>
erix
No ok, a gdzie przez cURL logujesz się na stronie?
masterek2009
https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi
erix
Spoko, ten system akurat znam.

Ale gdzie masz w skrypcie przekazywanie danych autoryzacyjnych? tongue.gif
masterek2009
Niestety nie ma. Chodzi ci o to ? 

 
Cytat
if ($login && $password)
  {
  $data .= "Authorization: Basic " . base64_encode("{$login}:{$password}") . "\r\n";
  }
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.