- Impact
- 1
my script stopped pulling videos from redtube i been trying to updat the code but my luck is not going my way do you see a problem? thanks
PHP:
<html><head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css" />
<?
include ("../includes/db.conf.php");
include ("../includes/connect.inc.php");
include ("../includes/funcs.php");
$queryad=mysql_query("Select * from admin where id='1' ");
$rowpad=mysql_fetch_array($queryad);
if($_COOKIE[$rowpad['cookie']]==$rowpad['ip']){
if(isset($_GET['search'])){
$search=$_GET['search'];
$search=str_replace(" ", "+",$search);
if(isset($_GET['page'])){
$param="?search=$search&page=$_GET[page]";
$page=$_GET['page'];
}else{
$param="?search=$search";
$page=1;
}
$url="http://www.redtube.com/$param";
}else{
$search="hardcore";
$url="http://www.redtube.com/?search=$search";
$page=1;
}
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times
$f = curl_exec($ch); // run the whole process
curl_close($ch);
//echo $f;
preg_match_all("/class=s target=_blank.{2,100}a>/",$f, $vids, PREG_PATTERN_ORDER);
//echo $vids[0][0] . "<br>, " . $vids[0][1] . "\n";
preg_match_all("/class=t.{2,111}onmouseout/",$f, $thumbs, PREG_PATTERN_ORDER);
//echo $thumbs[0][0] . "<br>, " . $thumbs[0][1] . "\n";
// class=t width=160 height=120 src='http://thumbs.redtube.com/_thumbs/0000011/0011194/0011194_006.jpg' onmouseout
echo "<table id='leftp' cellspacing='20'>";
echo "<tr><td align='center' colspan=2><form action='redtube.php' method='get'><input type='text' name='search'><input type='submit' value='Search'></form></td></tr>";
for ($i = 0; $i <= 19; $i++) {
if($vids[0][$i]==""){
break;
}
$bgk=$i;
preg_match("/[0-9]{2,5}/",$vids[0][$bgk], $vid0);
preg_match("/>[a-zA-Z0-9].*</",$vids[0][$bgk], $ptitle0);
$title0 = str_replace("<", "", $ptitle0[0]);
$title0 = str_replace(">", "", $title0);
preg_match("/http.*jpg/",$thumbs[0][$i], $thumb0);
preg_match("/\/.{2,20}jpg/",$thumb0[0], $thumbb);
$thumbq = str_replace("/", "", $thumbb[0]);
$queryp=mysql_query("Select * from videos where thumb='$thumbq' ");
$rowpnum=mysql_num_rows($queryp);
echo mysql_error();
if($rowpnum==0){
$esvi0=$vid0[0];
$esti0=$title0;
$esth0=$thumb0[0];
echo "<tr><td align='center' colspan=2><b>$esti0</b><br /><a href='rtpv.php?id=$esvi0&thumb=$i&sterm=$search&page=$page&title=$esti0' target='pw'><img src='$esth0' border=0></a></td></tr>\n";
}//end if
}
if($_GET['page']>0){
$prev=$_GET['page']-1;
$next=$_GET['page']+1;
echo "<tr><td align='center'><a href='redtube.php?search=$search&page=$prev'><b>Prev</b></a></td><td align='center'> <a href='redtube.php?search=$_GET[search]&page=$next'><b>Next</b></a></td></tr>";
}else{
echo "<tr><td colspan=2> <a href='redtube.php?search=$search&page=2'><b>Next</b></a></td></tr>";
}
echo "</table>";
}
?>
</body>
</html>