Guest User

Untitled

a guest
Aug 14th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4.  
  5. if ( $_SERVER['REQUEST_METHOD'] == 'HEAD' )
  6. {
  7.     header('HTTP/1.1 200 OK');
  8.     header('Host: media32.justin.tv');
  9.     header('User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0');
  10.     header('Connection: keep-alive');
  11.     header('Cookie: language=en');
  12.     header('Range: bytes=162-');
  13.     header('Content-Type: video/x-flv');
  14.     return;
  15. }
  16.  
  17. $rawURL = $_GET['itemurl'];
  18.  
  19.     doTheMiracle($rawURL);
  20.  
  21.  
  22. function doTheMiracle($prmUrl)
  23. {
  24.     header('Content-type: video/x-flv');
  25.     header('Content-Disposition: attachment; filename="wdlxtv.flv"');
  26.     if(isset ($_SERVER['CONTENT_LENGTH']))
  27.                 header("Content-Length: {$_SERVER['CONTENT_LENGTH']}");
  28.             else
  29.                 header('Content-Length: 1073741823');
  30.             // jump to the specific range if the MediaPlayer specifies it (when navigating)
  31.             if(isset ($_SERVER['HTTP_RANGE']))
  32.                 header("Range: {$_SERVER['HTTP_RANGE']}");
  33.     header('Cache-control: no-cache');
  34.     header("Accept-Ranges: bytes");
  35.     header('Connection: keep-alive');
  36.     $cmd = "ffmpeg -y -i '$prmUrl' -vcodec copy -acodec copy -f flv pipe:1";
  37.     set_time_limit(0);
  38.     passthru($cmd);
  39. }
Add Comment
Please, Sign In to add comment