Advertisement
Th3-822

[rapidleech][d] filereactor_com.php

May 15th, 2012
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.13 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once ("index.html");
  5.     exit();
  6. }
  7.  
  8. class filereactor_com extends DownloadClass {
  9.     private $page, $cookie;
  10.     public function Download($link) {
  11.         global $premium_acc;
  12.         $this->cookie = array('lang' => 'english');
  13.  
  14.         if (stripos($link, '://filereactor.com') !== false) $link = str_replace('://', '://www.', $link);
  15.         $this->page = $this->GetPage($link, $this->cookie);
  16.         is_present($this->page, "The file you were looking for could not be found");
  17.         is_present($this->page, "No such file with this filename", 'Error: Invalid filename, check your link and try again.');
  18.         is_present($this->page, "The file was removed by administrator");
  19.  
  20.         if ($_REQUEST["premium_acc"] == "on" && ((!empty($_REQUEST["premium_user"]) && !empty($_REQUEST["premium_pass"])) || (!empty($premium_acc["filereactor_com"]["user"]) && !empty($premium_acc["filereactor_com"]["pass"])))) {
  21.             $this->Login($link);
  22.         } else {
  23.             $this->FreeDL($link);
  24.         }
  25.     }
  26.  
  27.     private function FreeDL($link) {
  28.         if (empty($_POST['step']) || $_POST['step'] != '1') {
  29.             $page2 = cut_str($this->page, 'Form method="POST" action=\'', '</form>'); //Cutting page
  30.             $post = array();
  31.             $post['op'] = cut_str($page2, 'name="op" value="', '"');
  32.             is_notpresent($post['op'], 'download', 'Error parsing download post data.');
  33.             $post['usr_login'] = (empty($this->cookie['xfss'])) ? '' : $this->cookie['xfss'];
  34.             $post['id'] = cut_str($page2, 'name="id" value="', '"');
  35.             $post['fname'] = cut_str($page2, 'name="fname" value="', '"');
  36.             $post['referer'] = '';
  37.             $post['method_free'] = cut_str($page2, 'name="method_free" value="', '"');
  38.  
  39.             $page = $this->GetPage($link, $this->cookie, $post);
  40.             if (preg_match('@You can download files up to \d+ [K|M|G]b only.@i', $page, $err)) html_error("Error: ".$err[0]);
  41.             if (preg_match('@You (?:(?:have to)|(?:must)) wait (?:\d+ \w+,\s)?\d+ \w+ (?:un)?till? (?:your )?next download@', $page, $err)) html_error("Error: ".$err[0]);
  42.  
  43.             $page2 = cut_str($page, '<form name="F1" method="POST"', '</form>'); //Cutting page
  44.  
  45.             if (!preg_match('@<span id="countdown_str">[^<|>]+<span[^>]*>(\d+)</span>[^<|>]+</span>@i', $page2, $count)) $count = array(1=>30);
  46.             if ($count[1] > 0) $this->CountDown($count[1]);
  47.  
  48.             if (!preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $page, $pid)) html_error('Error: reCAPTCHA not found.');
  49.  
  50.             $data = $this->DefaultParamArr($link, (empty($this->cookie['xfss'])) ? 0 : encrypt(CookiesToStr($this->cookie)));
  51.             $post = array();
  52.             $data['T8[op]'] = cut_str($page2, 'name="op" value="', '"');
  53.             is_notpresent($data['T8[op]'], 'download', 'Error parsing download post data (2).');
  54.             $data['T8[id]'] = cut_str($page2, 'name="id" value="', '"');
  55.             $data['T8[rand]'] = cut_str($page2, 'name="rand" value="', '"');
  56.             $data['T8[method_free]'] = cut_str($page2, 'name="method_free" value="', '"');
  57.             $data['step'] = 1;
  58.             $this->Show_reCaptcha($pid[1], $data);
  59.         } else {
  60.             if (empty($_POST['recaptcha_response_field'])) html_error("You didn't enter the image verification code.");
  61.  
  62.             $this->cookie = (!empty($_POST['cookie'])) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array();
  63.             $this->cookie['lang'] = 'english';
  64.  
  65.             $post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']);
  66.             $post['op'] = $_POST['T8']['op'];
  67.             $post['id'] = $_POST['T8']['id'];
  68.             $post['rand'] = $_POST['T8']['rand'];
  69.             $post['referer'] = '';
  70.             $post['method_free'] = $_POST['T8']['method_free'];
  71.             $post['down_script'] = 1;
  72.  
  73.             $page = $this->GetPage($link, $this->cookie, $post);
  74.             is_present($page, "Wrong captcha", "Error: Wrong captcha.");
  75.             is_present($page, "Skipped countdown", "Error: Skipped countdown?.");
  76.             if (preg_match('@You (?:(?:have to)|(?:must)) wait (?:\d+ \w+,\s)?\d+ \w+ (?:un)?till? (?:your )?next download@', $page, $err)) html_error("Error: ".$err[0]);
  77.             if (!preg_match('@href="(https?://[^/|\"]+/(?:(?:files)|(?:dl?))/[^\"|>]+)"@i', $page, $dlink)) html_error('Error: Download link not found.');
  78.  
  79.             $FileName = urldecode(basename(parse_url($dlink[1], PHP_URL_PATH)));
  80.             $this->RedirectDownload($dlink[1], $FileName);
  81.         }
  82.     }
  83.  
  84.     private function Show_reCaptcha($pid, $inputs) {
  85.         global $PHP_SELF;
  86.  
  87.         if (!is_array($inputs)) {
  88.             html_error("Error parsing captcha data.");
  89.         }
  90.  
  91.         // Themes: 'red', 'white', 'blackglass', 'clean'
  92.         echo "<script language='JavaScript'>var RecaptchaOptions={theme:'red', lang:'en'};</script>\n";
  93.  
  94.         echo "\n<center><form name='dl' action='$PHP_SELF' method='post'><br />\n";
  95.         foreach ($inputs as $name => $input) {
  96.             echo "<input type='hidden' name='$name' id='$name' value='$input' />\n";
  97.         }
  98.         echo "<script type='text/javascript' src='http://www.google.com/recaptcha/api/challenge?k=$pid'></script>";
  99.         echo "<noscript><iframe src='http://www.google.com/recaptcha/api/noscript?k=$pid' height='300' width='500' frameborder='0'></iframe><br />";
  100.         echo "<textarea name='recaptcha_challenge_field' rows='3' cols='40'></textarea><input type='hidden' name='recaptcha_response_field' value='manual_challenge' /></noscript><br />";
  101.         echo "<input type='submit' name='submit' onclick='javascript:return checkc();' value='Download File' />\n";
  102.         echo "<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";
  103.         echo "</form></center>\n</body>\n</html>";
  104.         exit;
  105.     }
  106.  
  107.     private function PremiumDL($link) {
  108.         $page = $this->GetPage($link, $this->cookie);
  109.         if (!preg_match('@Location: (https?://[^/|\r|\n]+/(?:(?:files)|(?:dl?))/[^\r|\n]+)@i', $page, $dlink)) {
  110.             $page2 = cut_str($page, '<form name="F1" method="POST"', '</form>'); //Cutting page
  111.  
  112.             $post = array();
  113.             $post['op'] = cut_str($page2, 'name="op" value="', '"');
  114.             is_notpresent($post['op'], 'download', 'Error parsing download-post data.');
  115.             $post['id'] = cut_str($page2, 'name="id" value="', '"');
  116.             $post['rand'] = cut_str($page2, 'name="rand" value="', '"');
  117.             $post['referer'] = '';
  118.             $post['method_premium'] = cut_str($page2, 'name="method_premium" value="', '"');
  119.             $post['down_direct'] = 1;
  120.  
  121.             $page = $this->GetPage($link, $this->cookie, $post);
  122.  
  123.             if (!preg_match('@href="(https?://[^/|\"]+/(?:(?:files)|(?:dl?))/[^\"|>]+)"@i', $page, $dlink)) html_error('Error: Download-link not found.');
  124.         }
  125.  
  126.         $FileName = urldecode(basename(parse_url($dlink[1], PHP_URL_PATH)));
  127.         $this->RedirectDownload($dlink[1], $FileName);
  128.     }
  129.  
  130.     private function Login($link) {
  131.         global $premium_acc;
  132.         $pA = (!empty($_REQUEST["premium_user"]) && !empty($_REQUEST["premium_pass"]) ? true : false);
  133.         $user = ($pA ? $_REQUEST["premium_user"] : $premium_acc["filereactor_com"]["user"]);
  134.         $pass = ($pA ? $_REQUEST["premium_pass"] : $premium_acc["filereactor_com"]["pass"]);
  135.  
  136.         if (empty($user) || empty($pass)) html_error("Login Failed: User or Password is empty. Please check login data.", 0);
  137.         $post = array();
  138.         $post['login'] = urlencode($user);
  139.         $post['password'] = urlencode($pass);
  140.         $post['op'] = "login";
  141.         $post['redirect'] = "";
  142.  
  143.         $purl = 'http://www.filereactor.com/';
  144.         $page = $this->GetPage($purl, $this->cookie, $post, $purl);
  145.         is_present($page, "Incorrect Login or Password", "Login Failed: User/Password incorrect.");
  146.  
  147.         $this->cookie = GetCookiesArr($page);
  148.         if (empty($this->cookie['xfss'])) html_error("Login Error: Cannot find session cookie.");
  149.         $this->cookie['lang'] = 'english';
  150.  
  151.         $page = $this->GetPage("$purl?op=my_account", $this->cookie, 0, $purl);
  152.         //is_notpresent($page, '/?op=logout', 'Login Error.');
  153.         is_notpresent($page, '/logout', 'Login Error.');
  154.  
  155.         if (stripos($page, "Premium Account:") === false) {
  156.             $this->changeMesg(lang(300)."<br /><b>Account isn\\\'t premium</b><br />Using it as member.");
  157.             return $this->FreeDL($link);
  158.         } else return $this->PremiumDL($link);
  159.     }
  160. }
  161.  
  162. // [15-5-2012]  Written by Th3-822. (XFS... XFS everywhere. :D)
  163.  
  164. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement