Guest User

Untitled

a guest
Sep 10th, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. include 'functions.php';
  15. set_time_limit(0);
  16. ini_set('default_socket_timeout', 15);
  17. ini_set('memory_limit', -1);
  18. if (isset($argv[1]) && (strtoupper($argv[1]) == 'START')) {
  19. gc_enable();
  20. $rWait = 10000;
  21. $rFailWait = 15;
  22. $rKeyWait = 5;
  23. if (isset($argv[2]) && (strlen($argv[2]) == 32)) {
  24. $rChannel = $argv[2];
  25. plog('Shutting down previous instances.');
  26. exec('kill -9 `ps -ef | grep \'DRM_' . $rChannel . '\' | grep -v grep | awk \'{print $2}\'`');
  27. cli_set_process_title('DRM_' . $rChannel);
  28. $rDatabase = deleteCache($rChannel);
  29. $rDatabase = setCache($rDatabase, 'php_pid', getmypid());
  30. saveCache($rChannel, $rDatabase);
  31.  
  32. while (true) {
  33. plog('Starting: ' . $rChannel);
  34. $rSegmentCache = [];
  35. plog('Killing directory if exists.');
  36. exec('rm -rf ' . MAIN_DIR . 'video/' . $rChannel);
  37. exec('rm -rf ' . MAIN_DIR . 'hls/' . $rChannel);
  38. plog('Creating new directory.');
  39. mkdir(MAIN_DIR . 'video/' . $rChannel);
  40. mkdir(MAIN_DIR . 'video/' . $rChannel . '/aria');
  41. mkdir(MAIN_DIR . 'video/' . $rChannel . '/decrypted');
  42. mkdir(MAIN_DIR . 'video/' . $rChannel . '/encrypted');
  43. mkdir(MAIN_DIR . 'video/' . $rChannel . '/final');
  44. mkdir(MAIN_DIR . 'video/' . $rChannel . '/cache');
  45. mkdir(MAIN_DIR . 'hls/' . $rChannel);
  46. mkdir(MAIN_DIR . 'hls/' . $rChannel . '/hls');
  47. $rStarted = false;
  48. $rFFPID = NULL;
  49. $rStreamInfo = NULL;
  50. $rMemoryUsage = 0;
  51. $rPreviousID = 0;
  52. $rMPDs = [];
  53.  
  54. while (true) {
  55. plog('Start loop handler.');
  56. $rMemoryUsage = memory_get_usage();
  57. plog('Memory usage: ' . round($rMemoryUsage) . ' bytes');
  58. plog('DRM Processes: ' . getProcessCount());
  59. $rKeyFail = false;
  60. $rStart = round(microtime(true) * 1000);
  61.  
  62. if (!is_dir(MAIN_DIR . 'video/' . $rChannel . '/final')) {
  63. plog('Force stopped.');
  64. break;
  65. }
  66.  
  67. $rTime = time();
  68. $rCurrentMPD = NULL;
  69.  
  70. foreach (range(0, count($rMPDs) - 1) as $i) {
  71. if (($rMPDs[$i]['start'] <= $rTime) && ($rTime < $rMPDs[$i]['finish'])) {
  72. $rCurrentMPD = $i;
  73. }
  74. }
  75. if ((0 < $rCurrentMPD) || !isset($rCurrentMPD)) {
  76. $rCurrentMPD = 0;
  77. $rScheduleID = NULL;
  78. $rMPDs = [];
  79.  
  80. foreach (range(1, 2) as $rMPDID) {
  81. plog('Fetching MPD ' . $rMPDID . '...');
  82.  
  83. if (!$rScheduleID) {
  84. $rScheduleID = 'now';
  85. }
  86.  
  87. $rMPDInfo = json_decode(getURL('http://cbd46b77.cdn.cms.movetv.com/cms/api/channels/' . $rChannel . '/schedule/' . $rScheduleID . '/playback_info.qvt'), true);
  88. $rManifestURL = $rMPDInfo['playback_info']['dash_manifest_url'];
  89. plog('Manifest: ' . $rManifestURL);
  90. $rData = NULL;
  91. ..............................................................
  92. .........................................
  93. ................
Add Comment
Please, Sign In to add comment