. */ $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('/get($matches[1]); unlink("cookies.txt"); preg_match('/^Location: (.*)/im', $html, $matches); file_put_contents("history.txt", trim($matches[1])); return trim($matches[1]); } function dm($uri){ $uri = explode("?", $uri); $uri = $uri[0]; preg_match('#/video/(.*)#', $uri, $matches); $id = explode("#", $matches[1]); $id = $id[0]; $cc = new cURL (); $cc->headers[] = "User-Agent: Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"; $html = $cc->get("http://www.dailymotion.com/embed/video/".$id); unlink("cookies.txt"); preg_match('/var info = ({.*?)}},/s', $html, $matches); $matches[1] = stripslashes($matches[1]); $list = array(); if (preg_match('@"stream_h264_url":"(.*?)"@s', $matches[1], $url)){ if (!empty($url[1]) && $url[1] != "null"){$list[] = $url[1];} unset($url[1]); } if (preg_match('@"stream_h264_ld_url":"(.*?)"@s', $matches[1], $url)){ if (!empty($url[1]) && $url[1] != "null"){$list[] = $url[1];} unset($url[1]); } if (preg_match('@"stream_h264_hq_url":"(.*?)"@s', $matches[1], $url)){ if (!empty($url[1]) && $url[1] != "null"){$list[] = $url[1];} unset($url[1]); } if (preg_match('@"stream_h264_hd_url":"(.*?)"@s', $matches[1], $url)){ if (!empty($url[1]) && $url[1] != "null"){$list[] = $url[1];} unset($url[1]); } if (preg_match('@"stream_h264_hd1080_url":"(.*?)"@s', $matches[1], $url)){ if (!empty($url[1]) && $url[1] != "null"){$list[] = $url[1];} unset($url[1]); } if (preg_match('@"stream_live_hls_url":"(.*?)"@s', $matches[1], $url)){ if (!empty($url[1]) && $url[1] != "null"){$list[] = $url[1];} unset($url[1]); } if (preg_match('@"stream_hls_url":"(.*?)"@s', $matches[1], $url)){ if (!empty($url[1]) && $url[1] != "null"){$list[] = $url[1];} unset($url[1]); } if (preg_match('@"stream_audio_url":"(.*?)"@s', $matches[1], $url)){ if (!empty($url[1]) && $url[1] != "null"){$list[] = $url[1];} unset($url[1]); } $fh = fopen("history.txt", 'w'); for ($i=0;$iget($uri); preg_match('/mediaURL%22%3A%22(.*?)%22%7D/si', $html, $matches); $link = urldecode(urldecode($matches[1])); $link = preg_replace('/"/', "", $link); $link = preg_replace('/\\\/', "", $link); $link = preg_replace('/\,access:\[\{key:/', "?", $link); $link = preg_replace('/\,value:/', "=", $link); $link = preg_replace('/ /', "%20", $link); $link = preg_replace('/\[/', "%5B", $link); $link = preg_replace('/\]/', "%5D", $link); $link1 = $link; preg_match('/highDefinitionMP4(.*?)%22%7D/si', $html, $matches); preg_match('/mediaURL%22%3A%22(.+)/si', $matches[1], $matches); $link = urldecode(urldecode($matches[1])); $link = preg_replace('/"/', "", $link); $link = preg_replace('/\\\/', "", $link); $link = preg_replace('/\,access:\[\{key:/', "?", $link); $link = preg_replace('/\,value:/', "=", $link); $link = preg_replace('/ /', "%20", $link); $link = preg_replace('/\[/', "%5B", $link); $link = preg_replace('/\]/', "%5D", $link); $link2 = $link; $links = $link1."\r\n".$link2; unlink("cookies.txt"); file_put_contents("history.txt", $links); return $link1; } function decode_yt($cipher, $sig){ /* Per il decoding delle signatures riporto il copyright del creatore di tale funzione originariamente scritta in PERL e che io ho portato in PHP: Copyright © 2007-2014 Jamie Zawinski Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.*/ $c = explode(" ", $cipher); $s = str_split($sig); foreach ($c as $step){ if ($step == ""){ } elseif ($step == "r"){ $s = array_reverse($s); } elseif (preg_match("/^w(\d+)$/s", $step, $swap)){ $swap = $swap[1]; $temp = $s[0]; $s[0] = $s[$swap%count($s)]; $s[$swap] = $temp; } elseif (preg_match("/^s(\d+)$/s", $step, $slice)){ $s = array_slice($s, $slice[1]); } } return implode("", $s); } function grab_cipher($js){ preg_match('@-(.*?)/@si', $js, $cid); echo "\r\nDownloading JS's page...($cid[1])\r\n"; while (empty($html)){ $html = file_get_contents($js); } echo "\r\nParsing JS's functions...\r\n"; $pat = '[\$a-zA-Z][a-zA-Z\d]*'; $pat = "$pat(?:\.$pat)?"; preg_match("/$pat = ( $pat ) \.sig \|\| ( $pat ) \( \\1 \.s \)/sx", $html, $fun); if (empty($fun[2])){ die("\r\nUnparsable function!\r\n"); } $fun = $fun[2]; preg_match("/\bfunction\s+\Q$fun\E\s*\($pat\)\s*{(.*?)}/sx", $html, $fun); $fun = preg_replace("/var\s($pat)=($pat)\[0\];\\2\[0\]=\\2\[(\d+)%\\2\.length\];\\2\[\\3\]=\\1;/", "$2=swap($2,$3);", $fun[1]); $pieces = explode(";", $fun); $c = array(); foreach ($pieces as $piece){ if (preg_match("/^($pat)=\\1\.$pat\(\"\"\)$/", $piece)){ } elseif (preg_match("/^($pat)=\\1\.$pat\(\)$/", $piece)){ $c[] = "r"; } elseif (preg_match("/^($pat)=\\1.$pat\((\d+)\)$/", $piece, $num)){ $c[] = "s".$num[2]; } elseif (preg_match("/^($pat)=($pat)\(\\1,(\d+)\)$/", $piece, $sw) || preg_match("@^()($pat)\($pat,(\d+)\)address@hidden", $piece, $sw)){ $n = $sw[3]; $f = preg_replace('@address@hidden', "", $sw[2]); preg_match("@\b\Q$f\E:\s*function\s*\(.*?\)\s*({[^{}]+})@s", $html, $fn3); if (preg_match("@var\s($pat)=($pat)\[0\];@s", $fn3[1])){ $c[] = "w$n"; } elseif (preg_match("@\b$pat\.reverse\(@s", $fn3[1])){ $c[] = "r"; } elseif (preg_match("@address@hidden", $fn3[1]) || preg_match("@address@hidden", $fn3[1])){ $c[] = "s$n"; } } elseif (preg_match("@^return\s+$pat\.$pat\(\"\"\)address@hidden", $piece)){ } } $cipher = join(" ", $c); echo "\r\nCipher is: $cipher\r\n"; return $cipher; } function yt($uri){ $uri = str_replace('http://', 'https://', $uri); $cc = new cURL (); $html = $cc->get($uri); unlink("cookies.txt"); preg_match('@@', $html, $age_check); if ($age_check[1] == "18+"){ die("\r\nThis video is not supported! (Age check)\r\n"); } preg_match('/ytplayer.config = {(.*?)};/', $html, $data); $info = json_decode('{'.$data[1].'}', true); if (!$info["args"]["url_encoded_fmt_stream_map"]){ $hls_manifest = $info["args"]["hlsvp"]; if (empty($hls_manifest)){ die("\r\nCan't retrieve information!\r\n"); } $manifest = $cc->get($hls_manifest); unlink("cookies.txt"); preg_match_all('@https?://address@hidden', $manifest, $urls); $fh = fopen("history.txt", 'w'); for ($i=0;$iget($uri); if (preg_match("/\.16mm\.it\//", $uri)){ preg_match("/var contentId = '(.*?)'/si", $html, $matches); $id = $matches[1]; $html = $cc->get("http://www.16mm.it/html/metainfo.sjson?id=".$id); preg_match('/"id": "(.*?)"/si', $html, $matches); $data = $cc->get("http://cdnselector.xuniplay.fdnames.com/GetCDN.aspx?streamid=".$matches[1]); } else { preg_match("/var videoMetadataId = '(.*?)'/si", $html, $matches); $cc->headers[] = "Host: cdnselector.xuniplay.fdnames.com"; $cc->headers[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; $cc->headers[] = "Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3"; $data = $cc->get("http://cdnselector.xuniplay.fdnames.com/GetCDN.aspx?streamid=".$matches[1]); } preg_match_all('/