PageRenderTime 31ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/MyVideoTV.php

https://github.com/tejastank/Scripts
PHP | 43 lines | 28 code | 8 blank | 7 comment | 0 complexity | adda6a5cf67b4e2bb75532c8ac86894c MD5 | raw file
Possible License(s): GPL-3.0
  1. <?php
  2. function ShowHeader($header)
  3. {
  4. $len = strlen($header);
  5. $width = (int) ((80 - $len) / 2) + $len;
  6. $format = "\n%" . $width . "s\n\n";
  7. printf($format, $header);
  8. }
  9. ShowHeader("KSV MyVideoTV Downloader");
  10. /* Open the cipher */
  11. $td = mcrypt_module_open('arcfour', '', 'stream', '');
  12. $iv = "";
  13. /* Create key */
  14. $id = $argv[1];
  15. $key = md5("c8407a08b3c71ea418ec9dc662f2a56e40cbd6d5a114aa50fb1e1079e17f2b83" . md5($id));
  16. /* Intialize encryption */
  17. mcrypt_generic_init($td, $key, $iv);
  18. /* Encrypted data */
  19. $enc_xml = file_get_contents("http://www.myvideo.de/dynamic/get_player_video_xml.php?ID=$id&flash_playertype=D&autorun=yes");
  20. $enc_xml = explode("=", $enc_xml, 2);
  21. $enc_xml = $enc_xml[1];
  22. $encrypted = pack("H*", $enc_xml);
  23. /* Decrypt encrypted string */
  24. $decrypted = mdecrypt_generic($td, $encrypted);
  25. /* Terminate decryption handle and close module */
  26. mcrypt_generic_deinit($td);
  27. mcrypt_module_close($td);
  28. /* Show info */
  29. $xml = simplexml_load_string($decrypted);
  30. $video_params = $xml->{"playlist"}->{"videos"}->{"video"}->attributes();
  31. echo "Title : " . rawurldecode($video_params->{"title"}) . "\n";
  32. echo "RTMP : " . rawurldecode($video_params->{"connectionurl"}) . "\n";
  33. echo "Playpath : " . rawurldecode($video_params->{"source"}) . "\n";
  34. echo "HTTP : " . rawurldecode($video_params->{"path"} . $video_params->{"source"}) . "\n";
  35. ?>