Code:
<?php if ( isset( $_SERVER["HTTP_ACCEPT_ENCODING"] ) && substr_count( $_SERVER["HTTP_ACCEPT_ENCODING"], "gzip" ) ) ob_start( "ob_gzhandler" ) ; else ob_start() ; ########## curl + file_get_contents function tv( $url ) { if ( in_array( "curl", get_loaded_extensions() ) ) { $ch = curl_init() ; $array = array( CURLOPT_URL => $url, CURLOPT_HEADER => 0, CURLOPT_TIMEOUT => 10, CURLOPT_FRESH_CONNECT => 1, CURLOPT_RETURNTRANSFER => 1 ) ; curl_setopt_array( $ch, $array ) ; $result = curl_exec( $ch ) ; curl_close( $ch ) ; return $result ; } else { return @file_get_contents( $url ) ; } } ########## $query = htmlentities( $_GET["query"] ) ; $page = htmlentities( $_GET["page"] ) ; $chn = htmlentities( $_GET["chn"] ) ; echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" ; echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n" ; echo "<head>\n" ; if ( $query == "" ) { echo "<title>[Live Tv] Tvr, Pro Tv, Prima Tv, Antena 1, Kanal D, National Tv, Pro Cinema, Tv 1000, Realitatea, Romania Tv, Antena 3, Utv, Kiss Tv, Mtv, Digi Sport, Dolce Sport, Tlc, Discovery, National Geographic - " . ucwords( strtoupper( $_SERVER["SERVER_NAME"] ) ) . "</title>\n" ; } else { echo "<title>[Live Tv] " . ucwords( strtolower( str_replace( "-", " ", $query ) ) ) . " Televiziune Online - " . ucwords( strtoupper( $_SERVER["SERVER_NAME"] ) ) . "</title>\n" ; } echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n" ; echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>\n" ; echo "<meta http-equiv=\"Cleartype\" content=\"on\"/>\n" ; echo "<meta name=\"HandheldFriendly\" content=\"True\"/>\n" ; echo "<meta name=\"MobileOptimized\" content=\"320\"/>\n" ; echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\"/>\n" ; echo "<meta name=\"format-detection\" content=\"telephone=no\"/>\n" ; echo "<meta name=\"description\" content=\"Live, Tvr, Pro Tv, Prima Tv, Antena 1, Kanal D, National Tv, Pro Cinema, Tv 1000, Realitatea, Romania Tv, Antena 3, Utv, Kiss Tv, Mtv, Digi Sport, Dolce Sport, Tlc, Discovery, National Geographic\"/>\n" ; echo "<meta name=\"keywords\" content=\"live, tvr, pro tv, prima tv, antena 1, kanal d, national tv, pro cinema, tv 1000, realitatea, romania tv, antena 3, utv, kiss tv, mtv, digi sport, dolce sport, tlc, discovery, national geographic\"/>\n" ; echo "<meta name=\"robots\" content=\"index, follow\"/>\n" ; echo "<meta name=\"revisit-after\" content=\"1 days\"/>\n" ; echo "<link href=\"http://" . $_SERVER["SERVER_NAME"] . "/ico/tv.ico\" rel=\"icon\"/>\n" ; echo "<link href=\"http://" . $_SERVER["SERVER_NAME"] . "/css/tv.css\" rel=\"stylesheet\" type=\"text/css\"/>\n" ; echo "<script src=\"http://static.tastez.ro/js/vlc.js\" type=\"text/javascript\"></script>\n" ; echo "<script src=\"http://code.jquery.com/jquery-1.8.2.js\" type=\"text/javascript\"></script>\n" ; echo "<script src=\"http://code.jquery.com/ui/1.9.0/jquery-ui.js\" type=\"text/javascript\"></script>\n" ; echo "<script src=\"http://jwpsrv.com/library/4+R8PsscEeO69iIACooLPQ.js\" type=\"text/javascript\"></script>\n" ; echo "</head>\n" ; echo "<body>\n" ; if ( $query == "" ) { $curl = tv( "http://tastez.ro/tv.php" ) ; $grab = explode( '<u>Alege server:</u>', $curl ) ; $rest = explode( '<div class="check">', $grab[1] ) ; $show = preg_replace( array( "/<div class=\"line\">(.+?)<\/div>/si", "/\/tv.php/" ), array( "<p>$1</p>", $_SERVER["PHP_SELF"] ), $rest[0] ) ; echo $show . "\n" ; echo "</body>\n" ; echo "</html>\n" ; exit() ; } else if ( $query == $query ) { if ( $chn != "" ) { $curl = tv( "http://tastez.ro/tv.php?query=" . $query . "&chn=" . $chn ) ; } else { $curl = tv( "http://tastez.ro/tv.php?query=" . $query . "&page=" . $page ) ; } $grab = explode( '<div id="fb-root"></div>', $curl ) ; $rest = explode( '<div class="footer">', $grab[1] ) ; $show = preg_replace( array( "/<script>(.+?)<\/script>/si", "/<div class=\"fb\">(.+?)<\/div>/si", "/<div class=\"line\">(.+?)<\/div>/si", "/<div class=\"page-select\">(.+?)<\/div>/si", "/<div class=\"page-unselect\">(.+?)<\/div>/si", "/\/tv.php/" ), array( "", "", "<p>$1</p>", "[$1]", "$1", $_SERVER["PHP_SELF"] ), $rest[0] ) ; echo $show . "\n" ; echo "</body>\n" ; echo "</html>\n" ; exit() ; } else { header( "Location: " . $_SERVER["PHP_SELF"] ) ; } ob_end_flush() ; ?>