<?php
// Forobeta.com - by Dieguit0sk8
function cURL($url, $posts, $cookies, $referer, $proxy, $redir){
$headers = array (
'Accept-Language: en-US;q=0.6,en;q=0.4',
);
$tiempo = time();
$agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; es-MX; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
if($proxy){
if(stristr($proxy, '@')){
$datosproxy = explode('@', $proxy);
curl_setopt($ch, CURLOPT_PROXY, $datosproxy[1]);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $datosproxy[0]);
//echo $datosproxy[0];
}else{
curl_setopt($ch, CURLOPT_PROXY, $proxy);
}
}
if($posts){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $posts);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$page = curl_exec($ch);
if($redir){
$response = curl_getinfo($ch,CURLINFO_EFFECTIVE_URL);
}
curl_close($ch);
if($redir){
return $response;
} elseif($page){
return $page;
} else {
return 'Forbidden';
}
}
function parsear($i,$f,$s) {
list($crap,$y) = explode($i,$s,2);
list($x,$shit) = explode($f,$y,2);
return $x;
}
$cookies = 'elreyxhd.txt';
$cookies2 = 'pelisplus.txt';
$link = 'http://www.pelisplus.tv/pelicula/interstellar/';
$pelisplus = cURL($link, '', $cookies2, 'http://www.pelisplus.tv/', '', '');
$elreyxhd = parsear("<iframe width='100%' height='400' src='","'",$pelisplus);
$elreyxhd = str_replace(' ', '+', $elreyxhd);
$video = cURL($elreyxhd, '', $cookies, $link, '', '');
$id = parsear("?id=","&",$elreyxhd);
if($video !== "Forbidden") {
echo cURL('http://www.elreyxhd.com/samir.php?id='.$id.'&tipo=peliculas&idioma=latino', '', $cookies, $elreyxhd, '', 'SI');
} else {
echo 'Hay un problema...';
}
?>