Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class tw_vjs_tv_zing_vn extends tw_videojs_getlink{
- private $_key = 'f_pk_ZingTV_1_@z';
- private $_iv = 'f_iv_ZingTV_1_@z';
- public $_result = '';
- public $_text = '';
- public function zing_decrypt(){
- if($this->_text != ''){
- $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
- $iv_size = mcrypt_enc_get_iv_size($cipher);
- if(mcrypt_generic_init($cipher, $this->_key, $this->_iv) != -1){
- $cipherText = mdecrypt_generic($cipher,$this->zing_hexToString($this->_text));
- mcrypt_generic_deinit($cipher);
- $this->_result = $cipherText;
- return true;
- }else{
- return false;
- }
- }
- }
- public function zing_hexToString($hex){
- if(!is_string($hex)){
- return null;
- }
- $char = '';
- for($i = 0; $i < strlen($hex); $i += 2){
- $char .= chr(hexdec($hex{$i} . $hex{($i + 1)}));
- }
- return $char;
- }
- public function get_link($url){
- $full_content = $this->get_content($url);
- preg_match_all('/xmlURL: "([^>]*)",/U', $full_content, $link_zing);
- preg_match('/<source src="(.*?)" type="(.*?)" \/>/is', $full_content, $type);
- $result['type'] = $type[2];
- $xml = str_replace( 'media', 'media-embed', $link_zing[1][0]);
- $sourceXML = file_get_contents('compress.zlib://' . $xml);
- for($i = 1; $i <= 3; $i++){
- $f360 = explode('<source streamingType="' . $i . '"><![CDATA[', $sourceXML);
- $f360 = explode(']]></source>', $f360[1]);
- $this->_text = $f360[0];
- if($this->zing_decrypt() != false){
- if($this->_result != ''){
- $f360 = explode('web_embed_flash', $this->_result);
- $result['360p'] = $f360[0] . 'web_embed_flash';
- $f480 = explode('<f480 streamingType="' . $i . '"><![CDATA[', $sourceXML);
- $f480 = explode(']]></f480>', $f480[1]);
- $this->_text = $f480[0];
- if($this->zing_decrypt() != false){
- $f480 = explode('web_embed_flash', $this->_result);
- $result['480p'] = $f480[0] . 'web_embed_flash';
- $f720 = explode('<f720 streamingType="' . $i . '"><![CDATA[',$sourceXML);
- $f720 = explode(']]></f720>', $f720[1]);
- $this->_text = $f720[0];
- if($this->zing_decrypt() != false){
- $f720 = explode('web_embed_flash', $this->_result);
- $result['720p'] = $f720[0] . 'web_embed_flash';
- }
- }
- break;
- }
- }
- }
- return $result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement