Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( $_SERVER['REQUEST_METHOD'] == 'HEAD' )
- {
- header('HTTP/1.1 200 OK');
- header('Host: media32.justin.tv');
- header('User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0');
- header('Connection: keep-alive');
- header('Cookie: language=en');
- header('Range: bytes=162-');
- header('Content-Type: video/x-flv');
- return;
- }
- $rawURL = $_GET['itemurl'];
- doTheMiracle($rawURL);
- function doTheMiracle($prmUrl)
- {
- header('Content-type: video/x-flv');
- header('Content-Disposition: attachment; filename="wdlxtv.flv"');
- if(isset ($_SERVER['CONTENT_LENGTH']))
- header("Content-Length: {$_SERVER['CONTENT_LENGTH']}");
- else
- header('Content-Length: 1073741823');
- // jump to the specific range if the MediaPlayer specifies it (when navigating)
- if(isset ($_SERVER['HTTP_RANGE']))
- header("Range: {$_SERVER['HTTP_RANGE']}");
- header('Cache-control: no-cache');
- header("Accept-Ranges: bytes");
- header('Connection: keep-alive');
- $cmd = "ffmpeg -y -i '$prmUrl' -vcodec copy -acodec copy -f flv pipe:1";
- set_time_limit(0);
- passthru($cmd);
- }
Add Comment
Please, Sign In to add comment