Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> cURL logowanie rapidshare
masterek2009
post 23.06.2009, 18:13:40
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 5.02.2009

Ostrzeżenie: (0%)
-----


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>";
}
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
erix
post 23.06.2009, 18:28:31
Post #2





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Ok, a gdzie masz dane do logowania?


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
masterek2009
post 23.06.2009, 18:44:58
Post #3





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 5.02.2009

Ostrzeżenie: (0%)
-----


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 />";
}
?>


Ten post edytował masterek2009 23.06.2009, 18:45:18
Go to the top of the page
+Quote Post
erix
post 23.06.2009, 18:50:49
Post #4





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




No ok, a gdzie przez cURL logujesz się na stronie?


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
masterek2009
post 23.06.2009, 18:52:20
Post #5





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 5.02.2009

Ostrzeżenie: (0%)
-----


https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi
Go to the top of the page
+Quote Post
erix
post 23.06.2009, 18:59:23
Post #6





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Spoko, ten system akurat znam.

Ale gdzie masz w skrypcie przekazywanie danych autoryzacyjnych? tongue.gif


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
masterek2009
post 19.07.2009, 21:27:23
Post #7





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 5.02.2009

Ostrzeżenie: (0%)
-----


Niestety nie ma. Chodzi ci o to ? 

 
Cytat
if ($login && $password)
  {
  $data .= "Authorization: Basic " . base64_encode("{$login}:{$password}") . "\r\n";
  }
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 08:26