Advertisement
Guest User

zxc

a guest
Nov 9th, 2017
952
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.46 KB | None | 0 0
  1. <?php
  2. function Cget($url,$ref=0) {
  3.     $headers = Array(
  4.     'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg',
  5.     'Connection: Keep-Alive',
  6.     'Accept: */*',
  7.     'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
  8.     );
  9.     $process = curl_init($url);
  10.     curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
  11.     curl_setopt($process, CURLOPT_HEADER, 0);
  12.     if($ref)
  13.     {
  14.         curl_setopt($process, CURLOPT_REFERER, $ref);
  15.     }
  16.     curl_setopt($process, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36');
  17.     curl_setopt($process, CURLOPT_COOKIEFILE, realpath('cookie.txt'));
  18.     curl_setopt($process, CURLOPT_COOKIEJAR, realpath('cookie.txt'));
  19.     curl_setopt($process,CURLOPT_ENCODING , 'gzip');
  20.     curl_setopt($process, CURLOPT_TIMEOUT, 30);
  21.     curl_setopt($process, CURLOPT_SSL_VERIFYPEER, false);
  22.     curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
  23.     curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
  24.     $return = curl_exec($process);
  25.     curl_close($process);
  26.     return $return;
  27. }
  28. function getLocation($url) {
  29.     $headers = Array(
  30.         'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg',
  31.         'Connection: Keep-Alive',
  32.         'Accept: */*',
  33.         'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
  34.     );
  35.     $ch = curl_init($url);
  36.     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  37.     curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36');
  38.     curl_setopt($ch, CURLOPT_COOKIEFILE, realpath('cookie.txt'));
  39.     curl_setopt($ch, CURLOPT_COOKIEJAR, realpath('cookie.txt'));
  40.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  41.     curl_setopt($ch, CURLOPT_HEADER, TRUE);
  42.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
  43.     $response = curl_exec($ch);
  44.     preg_match_all('/^Location:(.*)$/mi', $response, $matches);
  45.     curl_close($ch);
  46.     return trim($matches[1][0]);
  47. }
  48. function Cpost($url,$data, $ref=0) {
  49.     $headers = Array(
  50.     'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg',
  51.     'Connection: Keep-Alive',
  52.     'Accept: */*',
  53.     'Content-Type: application/x-www-form-urlencoded; charset=utf-8',
  54.     'Referer: https://www.pornhubpremium.com/premium/login'
  55.     );
  56.     $process = curl_init($url);
  57.     curl_setopt($process, CURLOPT_URL, $url);
  58.     curl_setopt($process, CURLOPT_HEADER, 1);
  59.     //curl_setopt($process, CURLOPT_COOKIESESSION, false);
  60.     curl_setopt($process, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36');
  61.     curl_setopt($process, CURLOPT_COOKIEFILE, realpath('cookie.txt'));
  62.     curl_setopt($process, CURLOPT_COOKIEJAR, realpath('cookie.txt'));
  63.     curl_setopt($process, CURLOPT_SSL_VERIFYPEER, false);
  64.     if($ref)
  65.     {
  66.         curl_setopt($process, CURLOPT_REFERER, $ref);
  67.     }
  68.     curl_setopt($process,CURLOPT_ENCODING , 'gzip');
  69.     curl_setopt($process, CURLOPT_POSTFIELDS, $data);
  70.     curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
  71.     curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
  72.     curl_setopt($process, CURLOPT_POST, 1);
  73.     $return = curl_exec($process);
  74.     curl_close($process);
  75.     return $return;
  76. }
  77. function curl($url){
  78.     $ch = @curl_init();
  79.     curl_setopt($ch, CURLOPT_URL, $url);
  80.     $head[] = "Connection: keep-alive";
  81.     $head[] = "Keep-Alive: 300";
  82.     $head[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
  83.     $head[] = "Accept-Language: en-us,en;q=0.5";
  84.     curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36');
  85.     curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
  86.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  87.     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  88.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  89.     curl_setopt($ch, CURLOPT_TIMEOUT, 60);
  90.     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
  91.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  92.     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  93.     $page = curl_exec($ch);
  94.     curl_close($ch);
  95.     return $page;
  96. }
  97. function explode_by($begin,$end,$data) {
  98.     $data = explode($begin,$data);
  99.     $data = explode($end,$data[1]);
  100.     return $data[0];
  101. }
  102. //login
  103. $html = Cget("https://www.pornhubpremium.com/premium/login");
  104. $token = explode_by('id="token" value="','"',$html);
  105. $user = "litlb78";
  106. $pass = "camaro91";
  107. $data = "username=$user&password=$pass&token=$token&redirect=&from=pc_premium_login&segment=straight";
  108. $auth = "https://www.pornhubpremium.com/user/authenticate";
  109. $response = Cpost($auth,$data);
  110. echo $response;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement