Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $username = 'user';
- $userpass = 'pass';
- include('config.php');
- $url = 'http://www.tvtorrents.com/login.do';
- $queryurl = 'http://www.tvtorrents.com/loggedin/search.do?search=%s';
- $PostData = array('posted'=>'true','username'=>$username,'password'=>$userpass,'cookie'=>'Y','submit'=>' LOGIN ');
- $PostData = http_build_query($PostData);
- $fscurl = curl_init();
- $headers = array
- (
- 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*;q=0.8',
- 'Accept-Language: ru,en-us;q=0.7,en;q=0.3',
- 'Accept-Encoding: deflate',
- 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7'
- );
- curl_setopt($fscurl, CURLOPT_HTTPHEADER,$headers);
- curl_setopt($fscurl, CURLOPT_URL, $url);
- curl_setopt($fscurl, CURLOPT_FAILONERROR, 1);
- curl_setopt($fscurl, CURLOPT_REFERER, $url);
- curl_setopt($fscurl, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($fscurl, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($fscurl, CURLOPT_TIMEOUT, 20);
- curl_setopt($fscurl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox/3.0.4');
- curl_setopt($fscurl, CURLOPT_POST, 1);
- curl_setopt($fscurl, CURLOPT_COOKIEJAR, 'cookie.txt');
- curl_setopt($fscurl, CURLOPT_COOKIEFILE, 'cookie.txt');
- curl_setopt($fscurl, CURLOPT_POSTFIELDS, $PostData);
- curl_setopt($fscurl, CURLOPT_URL, sprintf($queryurl, urlencode($_GET['query'])));
- $response = curl_exec($fscurl);
- $cut_start = stripos($response,"<body");
- $cut_end = stripos($response,"<h2>SEARCH");
- $response = substr($response,1,$cut_start).substr($response,$cut_end);
- curl_close($fscurl);
- echo $response;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment