Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. <?php
  2. class tw_vjs_tv_zing_vn extends tw_videojs_getlink{
  3.  
  4. private $_key = 'f_pk_ZingTV_1_@z';
  5. private $_iv = 'f_iv_ZingTV_1_@z';
  6. public $_result = '';
  7. public $_text = '';
  8.  
  9. public function zing_decrypt(){
  10. if($this->_text != ''){
  11. $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
  12. $iv_size = mcrypt_enc_get_iv_size($cipher);
  13. if(mcrypt_generic_init($cipher, $this->_key, $this->_iv) != -1){
  14. $cipherText = mdecrypt_generic($cipher,$this->zing_hexToString($this->_text));
  15. mcrypt_generic_deinit($cipher);
  16. $this->_result = $cipherText;
  17. return true;
  18. }else{
  19. return false;
  20. }
  21. }
  22. }
  23.  
  24. public function zing_hexToString($hex){
  25. if(!is_string($hex)){
  26. return null;
  27. }
  28. $char = '';
  29. for($i = 0; $i < strlen($hex); $i += 2){
  30. $char .= chr(hexdec($hex{$i} . $hex{($i + 1)}));
  31. }
  32. return $char;
  33. }
  34.  
  35. public function get_link($url){
  36.  
  37. $full_content = $this->get_content($url);
  38. preg_match_all('/xmlURL: "([^>]*)",/U', $full_content, $link_zing);
  39. preg_match('/<source src="(.*?)" type="(.*?)" \/>/is', $full_content, $type);
  40. $result['type'] = $type[2];
  41. $xml = str_replace( 'media', 'media-embed', $link_zing[1][0]);
  42. $sourceXML = file_get_contents('compress.zlib://' . $xml);
  43. for($i = 1; $i <= 3; $i++){
  44. $f360 = explode('<source streamingType="' . $i . '"><![CDATA[', $sourceXML);
  45. $f360 = explode(']]></source>', $f360[1]);
  46. $this->_text = $f360[0];
  47. if($this->zing_decrypt() != false){
  48. if($this->_result != ''){
  49. $f360 = explode('web_embed_flash', $this->_result);
  50. $result['360p'] = $f360[0] . 'web_embed_flash';
  51. $f480 = explode('<f480 streamingType="' . $i . '"><![CDATA[', $sourceXML);
  52. $f480 = explode(']]></f480>', $f480[1]);
  53. $this->_text = $f480[0];
  54. if($this->zing_decrypt() != false){
  55. $f480 = explode('web_embed_flash', $this->_result);
  56. $result['480p'] = $f480[0] . 'web_embed_flash';
  57. $f720 = explode('<f720 streamingType="' . $i . '"><![CDATA[',$sourceXML);
  58. $f720 = explode(']]></f720>', $f720[1]);
  59. $this->_text = $f720[0];
  60. if($this->zing_decrypt() != false){
  61. $f720 = explode('web_embed_flash', $this->_result);
  62. $result['720p'] = $f720[0] . 'web_embed_flash';
  63. }
  64. }
  65. break;
  66. }
  67. }
  68. }
  69. return $result;
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement