Advertisement
jargon

Neinstar Filmz Video Handler 0-00 by Nick

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