Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(5555555);
- $search = 'Length: ';
- $nVideo = $_REQUEST['nVideo'];
- function sendRequest($strGET)
- {
- $sockData = "GET ".$strGET." HTTP/1.1\r\n";
- $sockData .= "User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; GT-P5210 Build/LMY48Z)\r\n";
- $sockData .= "Host: www.thwglobal.com\r\n";
- $sockData .= "Content-type: application/x-www-form-urlencoded\r\n";
- $sockData .= "Connection: Close\r\n\r\n";
- $sock = @fsockopen("thwglobal.com", 80, $errno, $errstr, 1);
- if (!$sock) die("$errstr ($errno)\n");
- fwrite($sock, $sockData);
- $headers = null;
- while ($str = trim(fgets($sock, 4096)))
- $headers .= "$str\n";
- $body = null;
- while (!feof($sock))
- $body .= @fread($sock, 8096);
- fclose($sock);
- unset($sock);unset($sockData);
- return $body;
- }
- for($i=0;$i<100;$i++)
- {
- $data = sendRequest('/VideoCenter/Watch?videoId='.$nVideo);
- $pos = strpos($data,$search);
- $pos2 = strpos($data,'The requested video has expired. Please select another video.');
- if($pos2)
- $valid = 'expired';
- else
- $valid = 'valid';
- if($pos)
- file_put_contents('recording.txt',$nVideo.'|'.substr($data,(strlen($search)+$pos),5).'|'.$valid."\r\n", FILE_APPEND | LOCK_EX);
- else
- file_put_contents('recording.txt',$nVideo."|00:00".'|'.$valid."\r\n", FILE_APPEND | LOCK_EX);
- $nVideo++;
- }
- echo '<meta http-equiv="refresh" content="0; URL=./twhglobal.php?nVideo='.$nVideo.'">';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement