.
*/
$version = "6.6.4";
error_reporting(0);
strncasecmp(php_uname('s'), "Win", 3) == 0 ? $windows = true : $windows = false;
if ($argc < 2){head($argv, $version);}
function arguments($argv) {
$ARG = array();
foreach ($argv as $arg) {
if (strpos($arg, '--') === 0) {
$compspec = explode('=', $arg);
$key = str_replace('--', '', array_shift($compspec));
$value = join('=', $compspec);
$ARG[$key] = $value;
} elseif (strpos($arg, '-') === 0) {
$key = str_replace('-', '', $arg);
if (!isset($ARG[$key])) $ARG[$key] = true;
}
}
return $ARG;
}
$opt = arguments($argv);
if ($opt["noplay"]){
$noplay = "TRUE";
}
if (isset($opt["referer"])){
$ref = $opt["referer"];
}
$uri = trim($argv[1]);
$host = explode("/", $uri);
$host = preg_replace("/www\./", "", $host[2]);
$check = explode(".", $host);
$check = count($check);
if ($check > 2){
$host = explode(".", $host);
$host = strtolower($host[1]);
} else {
$host = explode(".", $host);
$host = strtolower($host[0]);
}
if ($windows)
{
if (file_exists("C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe"))
$vlc = "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe";
else
$vlc = "C:\\Program Files\\VideoLAN\\VLC\\vlc.exe";
}
else
{
$vlc = "vlc";
$out = "2>/dev/null";
}
class cURL {
var $headers ;
var $user_agent ;
var $compression ;
var $cookie_file ;
var $proxy ;
function cURL ( $cookies = TRUE , $cookie = 'cookies.txt' , $compression = 'gzip' , $proxy = '' ) {
$this -> headers [] = 'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg' ;
$this -> headers [] = 'Connection: Keep-Alive' ;
$this -> headers [] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8' ;
$this -> user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0' ;
$this -> compression = $compression ;
$this -> proxy = $proxy ;
$this -> cookies = $cookies ;
if ( $this -> cookies == TRUE ) $this -> cookie ( $cookie );
}
function cookie ( $cookie_file ) {
if ( file_exists ( $cookie_file )) {
$this -> cookie_file = $cookie_file ;
} else {
fopen ( $cookie_file , 'w' ) or $this -> error ( 'The cookie file could not be opened. Make sure this directory has the correct permissions' );
$this -> cookie_file = $cookie_file ;
fclose ( $this -> cookie_file );
}
}
function get ( $url ) {
$process = curl_init ( $url );
curl_setopt ( $process , CURLOPT_HTTPHEADER , $this -> headers );
curl_setopt ( $process , CURLOPT_HEADER , 1 );
curl_setopt ( $process , CURLOPT_USERAGENT , $this -> user_agent );
if ( $this -> cookies == TRUE ) curl_setopt ( $process , CURLOPT_COOKIEFILE , $this -> cookie_file );
if ( $this -> cookies == TRUE ) curl_setopt ( $process , CURLOPT_COOKIEJAR , $this -> cookie_file );
if ( $this -> cookies == TRUE ) curl_setopt ( $process , CURLOPT_COOKIESESSION , true );
curl_setopt ( $process , CURLOPT_ENCODING , $this -> compression );
curl_setopt ( $process , CURLOPT_TIMEOUT , 30 );
if ( $this -> proxy ) curl_setopt ( $process , CURLOPT_PROXY , $this -> proxy );
//curl_setopt ( $process , CURLOPT_PROXYTYPE , CURLPROXY_SOCKS5 );
curl_setopt ( $process , CURLOPT_SSL_VERIFYPEER , 0 );
curl_setopt ( $process , CURLOPT_SSL_VERIFYHOST , 0 );
curl_setopt ( $process , CURLOPT_RETURNTRANSFER , 1 );
curl_setopt ( $process , CURLOPT_FOLLOWLOCATION , 0 );
$return = curl_exec ( $process );
curl_close ( $process );
return $return ;
}
function post ( $url , $data ) {
$process = curl_init ( $url );
curl_setopt ( $process , CURLOPT_HTTPHEADER , $this -> headers );
curl_setopt ( $process , CURLOPT_HEADER , 1 );
curl_setopt ( $process , CURLOPT_USERAGENT , $this -> user_agent );
if ( $this -> cookies == TRUE ) curl_setopt ( $process , CURLOPT_COOKIEFILE , $this -> cookie_file );
if ( $this -> cookies == TRUE ) curl_setopt ( $process , CURLOPT_COOKIEJAR , $this -> cookie_file );
if ( $this -> cookies == TRUE ) curl_setopt ( $process , CURLOPT_COOKIESESSION , true );
curl_setopt ( $process , CURLOPT_ENCODING , $this -> compression );
curl_setopt ( $process , CURLOPT_TIMEOUT , 30 );
if ( $this -> proxy ) curl_setopt ( $process , CURLOPT_PROXY , $this -> proxy );
//curl_setopt ( $process , CURLOPT_PROXYTYPE , CURLPROXY_SOCKS5 );
curl_setopt ( $process , CURLOPT_SSL_VERIFYPEER , 0 );
curl_setopt ( $process , CURLOPT_SSL_VERIFYHOST , 0 );
curl_setopt ( $process , CURLOPT_POSTFIELDS , $data );
curl_setopt ( $process , CURLOPT_RETURNTRANSFER , 1 );
curl_setopt ( $process , CURLOPT_FOLLOWLOCATION , 0 );
curl_setopt ( $process , CURLOPT_POST , 1 );
$return = curl_exec ( $process );
curl_close ( $process );
return $return ;
}
}
function fd($uri){
die("\r\nNot working from site\r\n");
$cc = new cURL ();
if (preg_match("/putlocker\.com/i", $uri)){
$uri = preg_replace('|putlocker.com/|i', "firedrive.com/", $uri);
}
$uri = str_replace(array("http://","/embed/"), array("https://","/file/"), $uri);
$html = $cc->get($uri);
preg_match('|name="confirm" value="(.*?)"|', $html, $confirm);
$confirm = "confirm=".$confirm[1];
$html = $cc->post($uri, $confirm);
die($html);
preg_match('|Play Video|', $html, $matches);
$matches[1] = str_replace("?mobile=", "?stream=", $matches[1]);
$tmx = $cc->get($matches[1]);
preg_match_all('/^Location: (.*)/mi', $tmx, $matches);
$link = trim($matches[1][0]);
preg_match('|href="(.*?)"\s?class="blue_btn" onclick="\$\(\'#download_menu|', $html, $matches);
$tmx = $cc->get($matches[1]);
preg_match_all('/^Location: (.*)/mi', $tmx, $matches);
$link2 = trim($matches[1][0]);
unlink("cookies.txt");
file_put_contents("history.txt", $link."\r\n".$link2);
return $link;
}
function vm($uri){
$uri = explode("?", $uri);
$uri = $uri[0];
$cc = new cURL ();
$html = $cc->get($uri);
preg_match('#data-config-url="(.*?)"#i', $html, $matches);
$tmp = str_replace('&', '&', $matches[1]);
$html = $cc->get($tmp);
unlink("cookies.txt");
preg_match('#"hd":{(.*?)}#i', $html, $hd);
preg_match('#"url":"(.*?)"#i', $hd[1], $high);
preg_match('#"sd":{(.*?)}#i', $html, $lq);
preg_match('#"url":"(.*?)"#i', $lq[1], $low);
preg_match('#"hls":{(.*?)}#i', $html, $hls);
preg_match('#"all":"(.*?)"#i', $hls[1], $hls_all);
preg_match('#"hd":"(.*?)"#i', $hls[1], $hls_hd);
$links = $low[1]."\r\n".$high[1]."\r\n".$hls_all[1]."\r\n".$hls_hd[1];
file_put_contents("history.txt", $links);
return $low[1];
}
function unwise1($str) { // Thanks mitm ;)
$chunks = str_split($str, 2);
$t = '';
for($c = 0; $c < sizeof($chunks); $c++) {
$t .= chr(intval($chunks[$c], 36));
}
return $t;
}
function unwise($w, $i, $s, $e){ // Thanks to me :)
$lIll = 0;
$ll1I = 0;
$Il1l = 0;
$ll1l = "";
$l1lI = "";
while (true){
if ($lIll < 5){
$l1lI .= substr($w, $lIll, 1);
} elseif ($lIll < strlen($w)){
$ll1l .= substr($w, $lIll, 1);
}
$lIll++;
if ($ll1I < 5){
$l1lI .= substr($i, $ll1I, 1);
} elseif ($ll1I < strlen($i)){
$ll1l .= substr($i, $ll1I, 1);
}
$ll1I++;
if ($Il1l < 5){
$l1lI .= substr($s, $Il1l, 1);
} elseif ($Il1l < strlen($s)){
$ll1l .= substr($s, $Il1l, 1);
}
$Il1l++;
$test1 = strlen($w) + strlen($i) + strlen($s) + strlen($e);
$test2 = strlen($ll1l) + strlen($l1lI) + strlen($e);
if ($test1 == $test2){
break;
}
}
$lI1l = $ll1l;
$I1lI = $l1lI;
$ll1I = 0;
unset($l1ll);
$l1ll = '';
for ($lIll=0;$lIll= strlen($l1lI)){
$ll1I = 0;
}
}
return $l1ll;
}
function wise_args($str){
$str = explode("(", $str);
$str = array_reverse($str);
$str = explode(")", $str[0]);
$str = str_replace(array("'",","), array("", " "), $str[0]);
return $str;
}
function wise_unpacker($html){
preg_match("/;eval(.*)/", $html, $match);
$wise_code = $match[1];
for ($i=0;$i<3;$i++){
$pre = wise_args($wise_code);
$args = explode(" ", $pre);
$wise_code = unwise($args[0], $args[1], $args[2], $args[3]);
}
return $wise_code;
}
function nv($uri){
$cc = new cURL ();
$html = $cc->get($uri);
preg_match('/flashvars.domain="(.*?)"/', $html, $matches);
$domain = $matches[1];
preg_match('/flashvars.file="(.*?)"/', $html, $matches);
$file = $matches[1];
preg_match('/flashvars.filekey="(.*?)"/', $html, $matches);
$filekey = $matches[1];
if (empty($filekey)){
preg_match('/flashvars.filekey=(.*?);/', $html, $matches);
$fkey = $matches[1];
preg_match("/var ${fkey}=\"(.*?)\"/", $html, $matches);
$filekey = $matches[1];
}
preg_match('/flashvars.cid="(.*?)"/', $html, $matches);
$cid = $matches[1];
$link = $domain."/api/player.api.php?cid2=undefined&pass=undefined&key=".$filekey."&user=undefined&cid3=undefined&cid=".$cid."&file=".$file;
$html = $cc->get($link);
unlink("cookies.txt");
preg_match('/url=(.*?)&/', $html, $matches);
file_put_contents("history.txt", $matches[1]);
return $matches[1];
}
function vh($uri){
$uri = explode("?", $uri);
$uri = $uri[0];
$cc = new cURL ();
$html = $cc->get($uri);
preg_match('/&permalinkId=(.*?)&/si', $html, $matches);
$id = $matches[1];
$html = $cc->get("http://www.veoh.com/iphone/views/watch.php?id=$id&__async=true&__source=waWatch");
preg_match('/