Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 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. function DAZNSegments($rURL, $rLimit = 20)
  15. {
  16. global $rMaxSegments;
  17. $rMPD = simplexml_load_string(geturl($rURL));
  18. $rURL = explode('web', $rURL)[0];
  19. $rBaseURL = $rURL . 'all/dash/';
  20.  
  21. foreach ($rMPD->Period->AdaptationSet[0]->ContentProtection as $rContentProtection) {
  22. if (strtolower($rContentProtection->attributes()->schemeIdUri) == 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed') {
  23. list($rPSSH) = explode('</cenc:pssh>', explode('<cenc:pssh>', $rContentProtection->asXML())[1]);
  24.  
  25. if (!$rPSSH) {
  26. list($rPSSH) = explode('<', explode('>', $rContentProtection->pssh->asXML())[1]);
  27. }
  28.  
  29. $rVideoStart = NULL;
  30. $rVideoTemplate = NULL;
  31. $rObject = [
  32. 'pssh' => $rPSSH,
  33. 'audio' => NULL,
  34. 'video' => NULL,
  35. 'segments' => [],
  36. 'add' => 100
  37. ];
  38.  
  39. foreach ($rMPD->Period->AdaptationSet as $rAdaptationSet) {
  40. $rRepID = $rAdaptationSet->Representation[count($rAdaptationSet->Representation) - 2]->attributes()['id'];
  41. $rVideoTemplate = str_replace('$RepresentationID$', $rRepID, $rAdaptationSet->SegmentTemplate[0]->attributes()['media']);
  42. $rInitSegment = str_replace('$RepresentationID$', $rRepID, $rBaseURL . $rAdaptationSet->SegmentTemplate[0]->attributes()['initialization']);
  43.  
  44. if ($rAdaptationSet->attributes()['contentType'] == 'video') {
  45. $rObject['video'] = $rInitSegment;
  46.  
  47. foreach ($rAdaptationSet->SegmentTemplate->SegmentTimeline->S as $rSegment) {
  48. if (isset($rSegment->attributes()['t'])) {
  49. $rVideoStart = $rSegment->attributes()['t'];
  50. $rObject['add'] = $rSegment->attributes()['d'];
  51. }
  52. }
  53. }
  54. }
  55.  
  56. foreach ($rMPD->Period->AdaptationSet as $rAdaptationSet) {
  57. $rThisSegment = NULL;
  58. $rRepID = $rAdaptationSet->Representation[0]->attributes()['id'];
  59. $rSegmentTemplate = str_replace('$RepresentationID$', $rRepID, $rAdaptationSet->SegmentTemplate[0]->attributes()['media']);
  60. $rInitSegment = str_replace('$RepresentationID$', $rRepID, $rBaseURL . $rAdaptationSet->SegmentTemplate[0]->attributes()['initialization']);
  61.  
  62. if ($rAdaptationSet->attributes()['contentType'] == 'audio') {
  63. $rObject['audio'] = $rInitSegment;
  64.  
  65. foreach ($rAdaptationSet->SegmentTemplate->SegmentTimeline->S as $rSegment) {
  66. if (isset($rSegment->attributes()['t'])) {
  67. $rThisSegment = $rSegment->attributes()['t'];
  68. $rObject['segments'][$rVideoStart]['audio'] = str_replace('$Time$', $rThisSegment, $rBaseURL . $rSegmentTemplate);
  69. $rObject['segments'][$rVideoStart]['video'] = str_replace('$Time$', $rVideoStart, $rBaseURL . $rVideoTemplate);
  70. }
  71.  
  72. if (isset($rSegment->attributes()['r'])) {
  73. $rRepeats = intval($rSegment->attributes()['r']) + 1;
  74. .............................................................
  75. .......................................
  76. ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement