jargon

Neinstar Filmz Video Handler 0-00 by Nick

Oct 1st, 2016
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.38 KB | None | 0 0
  1. <?php /* Neinstar Filmz Video Handler 0-00 by Nick */
  2.  
  3. $ini['acct']=$_GET['acct'];
  4. $ini['acct']=preg_replace('/([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])/','$1',$ini['acct']);
  5.  
  6. $ini['clip']=$_GET['clip'];
  7. $ini['clip']=preg_replace('/([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9X][0-9X][0-9X][0-9X][0-9X][0-9X][+-][0-9][0-9][0-9][0-9])/','$1',$ini['clip']);
  8.  
  9. $ini['code']=$_GET['code'];
  10. $ini['code']=preg_replace('/([0-9a-f][0-9a-f][0-9a-f]-[0-9a-f][0-9a-f][0-9a-f][0-9a-f])/','$1',$ini['code']);
  11.  
  12. if(strlen($ini['clip'])===0)
  13.     $ini['code']='20100917022551-0700';
  14.  
  15. if(strlen($ini['acct'])===0)
  16.     $ini['code']='0000000000';
  17.  
  18. if(strlen($ini['code'])===0)
  19.     $ini['code']='000-0000';
  20.  
  21. $ini['buff']=intval($_GET['buff']);
  22. if($ini['buff']<14400)
  23.     $ini['buff']=14400;
  24. if($ini['buff']>2<<10)
  25.     $ini['buff']=2<<10;
  26.  
  27. $fn='./clips/'.$ini['clip'].'.mp4';
  28.  
  29. if($ini['acct']==='0000000000') {
  30.     if(!is_file($fn)) {
  31.         header($_SERVER["SERVER PROTOCOL"].' 404 Not Found');
  32.         header('Content-Typ: video/mpeg');
  33.         header('Cache-Control: no-cache, must-revalidate');
  34.         header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
  35.     }
  36.     elseif($ini['code']==='000-0000') {
  37.         $fh=fopen($fn,'r');
  38.         $sz=filesize($fn);
  39.         $buf='';
  40.         header($_SERVER["SERVER PROTOCOL"].' 200 OK');
  41.         header('Content-Type: video/mpeg');
  42.         header('Content-Disposition: inline; filename="'.$ini['clip'].'.mp4"');
  43.         header('Content-Length: '.$sz);
  44.         header('Cache-Control: no-cache, must-revalidate');
  45.         header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
  46.         ob_start();
  47.         while(!feof($fh)) {
  48.             $length=($sz-ftell($fh));
  49.             if($length>=2<<10);
  50.                 $buf.=fread($fh,2<<10);
  51.             else
  52.                 $buf.=fread($fh,$length);
  53.             if((feof($fh)&&(strlen($buf)>0))||(strlen($buf>=$buffsz)) {
  54.                 echo $buf;
  55.                 $buf='';
  56.                 ob_end_flush();
  57.                 ob_start();
  58.             }
  59.         }
  60.         ob_end_flush();
  61.         fclose($fh);
  62.     }
  63.     else {
  64.         header($_SERVER["SERVER PROTOCOL"].' 503 Forbidden');
  65.         echo '503 Forbidden';
  66.     }
  67. }
  68. else {
  69.         header($_SERVER["SERVER PROTOCOL"].' 503 Forbidden');
  70.         echo '503 Forbidden';
  71. }
  72. echo '<html><body><table border="0px" cellpadding="0px" cellspacing="0px"><tr><td bgcolor="black" width="427px" height="240px" align="middle"><video src="'.$ini['clip'].'.mp4" autoplay="1" controls="" height="240px"></video></td></tr><tr><td align="left" style="font {variation: small-caps; size: +2;}">'.$ini['clip'].'</td></tr></table></body></html>';
  73. ?>
Add Comment
Please, Sign In to add comment