Advertisement
Th3-822

[rapidleech][d] freakshare_com.php

Feb 3rd, 2014
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.27 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once ('index.html');
  5.     exit();
  6. }
  7.  
  8. class freakshare_com extends DownloadClass {
  9.     private $page, $cookie, $pA;
  10.     public function Download($link) {
  11.         global $premium_acc;
  12.         $this->link = $link = str_ireplace('freakshare.net/', 'freakshare.com/', $link);
  13.         $this->cookie = array();
  14.         $this->DLRegexp = '@https?://\w+\.freakshare\.com/get\.php\?dlid=\w+@i';
  15.         $this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
  16.  
  17.         $_POST['step'] = empty($_POST['step']) ? false : $_POST['step'];
  18.         if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) {
  19.             $this->page = $this->GetPage($this->link, $this->cookie);
  20.             if (stripos($this->page, 'selected="selected">English<') === false) {
  21.                 $this->cookie = GetCookiesArr($this->GetPage('http://freakshare.com/index.php?language=EN', $this->cookie), $this->cookie);
  22.                 $this->page = $this->GetPage($this->link, $this->cookie);
  23.             }
  24.             is_present($this->page, 'This file does not exist!');
  25.             $this->cookie = GetCookiesArr($this->page, $this->cookie);
  26.         } elseif (!empty($_POST['cookie'])) $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
  27.  
  28.         if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($premium_acc['freakshare_com']['user']) && !empty($premium_acc['freakshare_com']['pass']))))) {
  29.             return $this->Login(($this->pA ? $_REQUEST['premium_user'] : $premium_acc['freakshare_com']['user']), ($this->pA ? $_REQUEST['premium_pass'] : $premium_acc['freakshare_com']['pass']));
  30.         } else return $this->FreeDL();
  31.     }
  32.  
  33.     private function FreeDL() {
  34.         switch ($_POST['step']) {
  35.             default:
  36.                 is_present($this->page, 'Your Traffic is used up for today!');
  37.                 if (!preg_match('@\svar\s+time\s*=\s*(\d+)@i', $this->page, $cD)) html_error('Countdown not found.');
  38.                 $this->cookie['ads_download'] = '1';
  39.                 if ($cD[1] >= 0) {
  40.                     if ($cD[1] > 59) {
  41.                         $data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
  42.                         $data['step'] = '1';
  43.                         return $this->JSCountdown($cD[1] + 1, $data);
  44.                     } else $this->CountDown($cD[1] + 1);
  45.                 }
  46.             case '1':
  47.                 $page = $this->GetPage($this->link, $this->cookie, array('section' => 'benefit', 'did' => '0'));
  48.                 if (!preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $page, $cpid)) html_error('CAPTCHA not found.');
  49.                 $data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
  50.                 $data['step'] = '2';
  51.                 return $this->Show_reCaptcha($cpid[1], $data);
  52.             case '2': break;
  53.         }
  54.  
  55.         if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
  56.         $post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']);
  57.         $post['section'] = 'waitingtime';
  58.         $post['did'] = '0';
  59.  
  60.         $page = $this->GetPage($this->link, $this->cookie, $post);
  61.         is_present($page, 'Wrong Captcha!', 'Login Failed: Wrong CAPTCHA entered.');
  62.  
  63.         if (!preg_match($this->DLRegexp, $page, $DL)) html_error('Download Link Not Found.');
  64.         $this->RedirectDownload($DL[0], 'T8_Freakshare_FDL');
  65.     }
  66.  
  67.     private function Show_reCaptcha($pid, $inputs, $sname = 'Download File') {
  68.         if (!is_array($inputs)) html_error('Error parsing captcha data.');
  69.  
  70.         // Themes: 'red', 'white', 'blackglass', 'clean'
  71.         echo "<script language='JavaScript'>var RecaptchaOptions = {theme:'red', lang:'en'};</script>\n\n<center><form name='recaptcha' action='{$GLOBALS['PHP_SELF']}' method='POST'><br />\n";
  72.         foreach ($inputs as $name => $input) echo "<input type='hidden' name='$name' id='C_$name' value='$input' />\n";
  73.         echo "<script type='text/javascript' src='http://www.google.com/recaptcha/api/challenge?k=$pid'></script><noscript><iframe src='http://www.google.com/recaptcha/api/noscript?k=$pid' height='300' width='500' frameborder='0'></iframe><br /><textarea name='recaptcha_challenge_field' rows='3' cols='40'></textarea><input type='hidden' name='recaptcha_response_field' value='manual_challenge' /></noscript><br /><input type='submit' name='submit' onclick='javascript:return checkc();' value='$sname' />\n<script type='text/javascript'>/*<![CDATA[*/\nfunction checkc(){\nvar capt=document.getElementById('recaptcha_response_field');\nif (capt.value == '') { window.alert('You didn\'t enter the image verification code.'); return false; }\nelse { return true; }\n}\n/*]]>*/</script>\n</form></center>\n</body>\n</html>";
  74.         exit;
  75.     }
  76.  
  77.     private function PremiumDL() {
  78.         $page = $this->GetPage($this->link, $this->cookie);
  79.         if (!preg_match($this->DLRegexp, $page, $DL)) {
  80.             $this->cookie = GetCookiesArr($page, $this->cookie);
  81.             $page = $this->GetPage($this->link, $this->cookie, array('section' => 'waitingtime', 'did' => '0'));
  82.             if (!preg_match($this->DLRegexp, $page, $DL)) html_error('Download-Link Not Found.');
  83.         }
  84.         $this->RedirectDownload($DL[0], 'T8_Freakshare_PDL');
  85.     }
  86.  
  87.     private function Login($user, $pass) {
  88.         if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.');
  89.         $post = array();
  90.         $post['user'] = urlencode($user);
  91.         $post['pass'] = urlencode($pass);
  92.         $post['submit'] = 'Login';
  93.  
  94.         $purl = 'http://freakshare.com/';
  95.         $page = $this->GetPage($purl.'login.html', $this->cookie, $post, $purl);
  96.         if (substr($page, 9, 3) == '200') is_present($page, 'Wrong Username or Password!', 'Login failed: User/Password incorrect.');
  97.  
  98.         $this->cookie = GetCookiesArr($page);
  99.         if (empty($this->cookie['login'])) html_error('Login Error: Cannot find session cookie.');
  100.  
  101.         $page = $this->GetPage($purl, $this->cookie, 0, $purl.'login.html');
  102.         is_notpresent($page, '/logout.html', 'Login Error.');
  103.  
  104.         if (stripos($page, 'selected="selected">English<') === false) {
  105.             $this->cookie = GetCookiesArr($this->GetPage($purl.'index.php?language=EN', $this->cookie, 0, $purl), $this->cookie);
  106.             $page = $this->GetPage($purl, $this->cookie, 0, $purl.'index.php?language=EN');
  107.         }
  108.  
  109.         if (stripos($page, 'Member (free)') !== false) {
  110.             $this->changeMesg(lang(300).'<br /><b>Account isn\\\'t premium</b><br />Using it as member.');
  111.             return $this->FreeDL();
  112.         }
  113.  
  114.         if (preg_match('@>\s*Traffic\s+left:\s*</td>\s*<td>\s*(\d+(?:\.\d+)?)\s+([KMGT]?B)@i', $page, $traffic)) {
  115.             $traffic = array($traffic[1], strtoupper($traffic[2]));
  116.             switch ($traffic[1]) { // KbOrMbOrGbToBytes :D
  117.                 case 'GB': $traffic[0] *= 1024;
  118.                 case 'MB': $traffic[0] *= 1024;
  119.                 case 'KB': $traffic[0] *= 1024;
  120.             }
  121.             $this->changeMesg(lang(300) . '<br />Acc. Traffic: ' . bytesToKbOrMbOrGb($traffic[0]));
  122.             if (preg_match('@\s(\d+(?:\.\d+)?)\s+([KMGT]?B)(?:ytes?)?</h1>@i', $this->page, $fs)) {
  123.                 $fs = array($fs[1], strtoupper($fs[2]));
  124.                 switch ($fs[1]) { // KbOrMbOrGbToBytes :D
  125.                     case 'GB': $fs[0] *= 1024;
  126.                     case 'MB': $fs[0] *= 1024;
  127.                     case 'KB': $fs[0] *= 1024;
  128.                 }
  129.                 if ($fs[0] > $traffic[0]) html_error('Insufficient account traffic for download this file ('.bytesToKbOrMbOrGb($fs[0]).')');
  130.             } elseif ($traffic[0] < 2 * 1024 * 1024 * 1024) html_error('Remaining Traffic < 2GB.');
  131.         }
  132.  
  133.         return $this->PremiumDL();
  134.     }
  135. }
  136.  
  137. // [03-1-2014] Written by Th3-822.
  138. // [09-2-2014] Fixed PremiumDL with DD off. - Th3-822
  139.  
  140. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement