public function get_video_data() { if (isset($video_data_array)) { return $video_data_array; } //utf8 encode and convert "&" $html = utf8_encode($this->get_page_html($this->url)); $html = str_replace("\\u0026amp;", "&", $html); // Extract text containing video information. preg_match_all('/"url_encoded_fmt_stream_map".*?"(.*?)"/i', $html, $matches); if (isset($matches[1][0])) { // Get array of data for each video present. // Need to url decode first. $video_data_collection = explode(',', $matches[1][0]); //var_dump($video_url_data); $video_data_array = array(); foreach ($video_data_collection as $video_raw_data) { $video_data = array(); $video_raw_data = unescapeUTF8EscapeSeq($video_raw_data); parse_str($video_raw_data, $video_data); preg_match('#(video\\/([A-Za-z\\-0-9]+))(;\\s*?codecs\\="(.+?)(,\\s*(.+?))?")?#', $video_data['type'], $matches1); if ($matches1) { $type_info = array(); // Container format if (isset($matches1[2])) { $type_info['format'] = $matches1[2]; } // Audio codec if (isset($matches1[4])) { $type_info['vcodec'] = $matches1[4]; } // Video codec if (isset($matches1[6])) { $type_info['acodec'] = $matches1[6]; } $video_data['type_info'] = $type_info; } $video_data['download_url'] = "{$video_data['url']}&signature={$video_data['sig']}"; $video_data_array[] = $video_data; } $this->video_data_array = $video_data_array; return $video_data_array; } else { // Video information could not be found. return FALSE; } }
public static function buil_down($epid) { $episode = MySql::dbselect('url', 'episode', "id = '{$epid}'"); $url = $episode[0][0]; $url = str_replace('https', 'http', $url); $is_picasa = preg_match('#picasaweb.google.com/(.*?)#s', $url); // Picasaweb $is_zingtv = preg_match("#tv.zing.vn/video/([^/]+)#", $url); // Zing TV $is_ggdocs = preg_match("#docs.google.com(.*?)#s", $url); // Google Docs $is_nct = preg_match("#nhaccuatui.com(.*?)#s", $url); // Nhaccuatui $is_dailymotion = preg_match("#dailymotion.com(.*?)#s", $url); // Dailymotion $is_youtube = preg_match("#youtube.com(.*?)#s", $url); // Youtube if ($is_picasa) { $data = file_get_contents($url); $mp4 = array(); $ht = explode('"media":{"content":', $data); $code = explode('"description":', $ht[1]); $link = explode('"url":"', $code[0]); for ($i = 2; $i < count($link); $i++) { $play = explode('"', $link[$i]); if (substr_count($play[0], "itag=5&") > 0) { array_push($mp4, "240p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=34&") > 0) { array_push($mp4, "360p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=6&") > 0) { array_push($mp4, "360p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=35&") > 0) { array_push($mp4, "480p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=59&") > 0) { array_push($mp4, "360p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=22&") > 0) { array_push($mp4, "720p [HD]|-|" . $play[0]); } if (substr_count($play[0], "itag=37&") > 0) { array_push($mp4, "1080p [HD]|-|" . $play[0]); } if (substr_count($play[0], "itag=38&") > 0) { array_push($mp4, "Ful HD|-|" . $play[0]); } } for ($i = 0; $i < count($mp4); $i++) { $d = explode('|-|', $mp4[$i]); $html .= "<a href=\"{$d['1']}\" title=\"Chất lượng {$d['0']}\" target=\"_blank\">{$d['0']}</a> - "; } $html = substr($html, 0, -7); } if ($is_zingtv) { } if ($is_nct) { $html = file_get_contents($url); $link = explode('&file=', $html); $link = explode('"', $link[1]); $url = $link[0]; $html = file_get_contents($url); $link = explode('<![CDATA[', $html); $link = explode(']]>', $link[3]); $link = $link[0]; $html = "<a href=\"{$link}\" title=\"Chất lượng 360p [SD]\" target=\"_blank\">360p [SD]</a> - "; $html = substr($html, 0, -7); } if ($is_ggdocs) { $data = file_get_contents($url); $mp4 = array(); $ht = explode('"fmt_stream_map":', $data); $code = explode('"fmt_list"', $ht[1]); $link = explode('|', urldecode(unescapeUTF8EscapeSeq($code[0]))); for ($i = 1; $i < count($link); $i++) { $play = explode('"', $link[$i]); if (substr_count($play[0], "itag=5&") > 0) { array_push($mp4, "240p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=34&") > 0) { array_push($mp4, "360p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=6&") > 0) { array_push($mp4, "360p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=35&") > 0) { array_push($mp4, "480p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=59&") > 0) { array_push($mp4, "360p [SD]|-|" . $play[0]); } if (substr_count($play[0], "itag=22&") > 0) { array_push($mp4, "720p [HD]|-|" . $play[0]); } if (substr_count($play[0], "itag=37&") > 0) { array_push($mp4, "1080p [HD]|-|" . $play[0]); } if (substr_count($play[0], "itag=38&") > 0) { array_push($mp4, "Ful HD|-|" . $play[0]); } } for ($i = 0; $i < count($mp4); $i++) { $d = explode('|-|', $mp4[$i]); $html .= "<a href=\"{$d['1']}\" title=\"Chất lượng {$d['0']}\" target=\"_blank\">{$d['0']}</a> - "; } $html = substr($html, 0, -7); } if ($is_youtube) { $my_id = VideoYoutubeID($url); $my_video_info = 'http://www.youtube.com/get_video_info?&video_id=' . $my_id; $my_video_info = curlGet($my_video_info); $thumbnail_url = $title = $url_encoded_fmt_stream_map = $type = $url = ''; parse_str($my_video_info); if (isset($url_encoded_fmt_stream_map)) { $my_formats_array = explode(',', $url_encoded_fmt_stream_map); } $avail_formats[] = ''; $i = 0; $ipbits = $ip = $itag = $sig = $quality = ''; $expire = time(); foreach ($my_formats_array as $format) { parse_str($format); $avail_formats[$i]['itag'] = $itag; $avail_formats[$i]['quality'] = $quality; $type = explode(';', $type); $avail_formats[$i]['type'] = $type[0]; $avail_formats[$i]['url'] = urldecode($url) . '&signature=' . $sig; parse_str(urldecode($url)); $avail_formats[$i]['expires'] = date("G:i:s T", $expire); $avail_formats[$i]['ipbits'] = $ipbits; $avail_formats[$i]['ip'] = $ip; $i++; } if (count($avail_formats) > 1) { for ($i = 0; $i < count($avail_formats); $i++) { $url = $avail_formats[$i]['url']; $chatluong = $avail_formats[$i]['type'] . ' (' . $avail_formats[$i]['quality'] . ')'; $html .= "<a href=\"{$url}\" title=\"Calidad {$chatluong}\" target=\"_blank\">{$chatluong}</a> - "; } } $html = substr($html, 0, -7); } $arrep = MySql::dbselect('subtitle', 'episode', "id = '{$epid}'"); $subtitle = urldecode($arrep[0][0]); if ($subtitle) { $html .= "<p>Nota: Este episodio debe <a href=\"{$subtitle}\" title=\"Descarga subtítulos\" target=\"_blank\">Descargar los subtitulos</a></p>"; } return $html; }
$player2 = 'player2'; $arrAds = array($player1, $player2); $rd = rand(0, count($arrAds) - 1); $id = "flashplayer" . rand(0, 999999999); $link = 'https://plus.google.com/photos/106135027719844357910/albums/5970312833136615089/5970595871311426930'; include 'Gkencode.php'; function gkEncode($link) { $gkencode = new Gkencode(); $secretKey = '8U3NjYvvmgPc80kIRAqs'; //not change return $gkencode->encrypt($link, $secretKey); } // echo gkEncode($link); $isDone = false; $url = unescapeUTF8EscapeSeq("http://redirector.googlevideo.com/videoplayback?id\\u003ded08610256a25fd1\\u0026itag\\u003d18\\u0026source\\u003dpicasa\\u0026cmo\\u003dsensitive_content%3Dyes\\u0026ip\\u003d0.0.0.0\\u0026ipbits\\u003d0\\u0026expire\\u003d1391355530\\u0026sparams\\u003did,itag,source,ip,ipbits,expire\\u0026signature\\u003dB986DB59E643D1C4E1C3DEDCF9BF1FBBE9985084.150A4DC076B477EA3E06975AC0BBE30A856352A3\\u0026key\\u003dlh1"); while (!$isDone) { $hd = get_headers_from_url($url); Zend_Debug::dump($hd); if (isset($hd['Location'])) { $url = $hd['Location']; } else { $isDone = true; } } ?> </div> </body> </html>