Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <?php
  2. set_time_limit(5555555);
  3. $search = 'Length: ';
  4. $nVideo = $_REQUEST['nVideo'];
  5. function sendRequest($strGET)
  6. {
  7.    
  8.     $sockData  = "GET ".$strGET." HTTP/1.1\r\n";
  9.     $sockData .= "User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; GT-P5210 Build/LMY48Z)\r\n";
  10.     $sockData .= "Host: www.thwglobal.com\r\n";
  11.     $sockData .= "Content-type: application/x-www-form-urlencoded\r\n";
  12.     $sockData .= "Connection: Close\r\n\r\n";
  13.    
  14.  
  15.  
  16.  
  17.     $sock = @fsockopen("thwglobal.com", 80, $errno, $errstr, 1);
  18.     if (!$sock) die("$errstr ($errno)\n");
  19.        
  20.     fwrite($sock, $sockData);
  21.  
  22.     $headers = null;
  23.     while ($str = trim(fgets($sock, 4096)))
  24.         $headers .= "$str\n";
  25.        
  26.        
  27.     $body = null;
  28.     while (!feof($sock))
  29.         $body .= @fread($sock, 8096);
  30.            
  31.     fclose($sock);
  32.     unset($sock);unset($sockData);
  33.     return $body;
  34. }
  35. for($i=0;$i<100;$i++)
  36. {
  37.     $data = sendRequest('/VideoCenter/Watch?videoId='.$nVideo);
  38.     $pos = strpos($data,$search);
  39.     $pos2 = strpos($data,'The requested video has expired.  Please select another video.');
  40.     if($pos2)
  41.         $valid = 'expired';
  42.     else
  43.         $valid = 'valid';
  44.    
  45.     if($pos)
  46.         file_put_contents('recording.txt',$nVideo.'|'.substr($data,(strlen($search)+$pos),5).'|'.$valid."\r\n", FILE_APPEND | LOCK_EX);
  47.     else
  48.         file_put_contents('recording.txt',$nVideo."|00:00".'|'.$valid."\r\n", FILE_APPEND | LOCK_EX);
  49.     $nVideo++;
  50. }
  51. echo '<meta http-equiv="refresh" content="0; URL=./twhglobal.php?nVideo='.$nVideo.'">';
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement