Advertisement
Th3-822

[rapidleech][d][premiumdl] filesmonster_com

Jan 21st, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.41 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit;
  6. }
  7.  
  8. class filesmonster_com extends DownloadClass {
  9.     private $link, $baseUrl, $fid, $page, $cookie = array('yab_ulanguage' => 'en'), $pA;
  10.     public function Download($link) {
  11.         $link = parse_url($link);
  12.         $link['scheme'] = 'https';
  13.         $link['host'] = 'filesmonster.com';
  14.         $link = rebuild_url($link);
  15.         if (!preg_match('@(https?://filesmonster\.com)/download\.php\?id=([\w\-\.%]+)@i', $link, $fid)) html_error('Invalid link?.');
  16.         $this->link = $GLOBALS['Referer'] = str_ireplace('http://', 'https://', $fid[0]);
  17.         $this->baseUrl = $fid[1];
  18.         $this->fid = $fid[2];
  19.  
  20.         $this->page = $this->GetPage($this->link, $this->cookie);
  21.         if (substr($this->page, 9, 3) == '404') html_error('File Not Found.');
  22.         $this->cookie = GetCookiesArr($this->page, $this->cookie);
  23.  
  24.         $this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
  25.         if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['filesmonster_com']['user']) && !empty($GLOBALS['premium_acc']['filesmonster_com']['pass']))))) {
  26.             $user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['filesmonster_com']['user']);
  27.             $pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['filesmonster_com']['pass']);
  28.             if ($this->pA && !empty($_POST['pA_encrypted'])) {
  29.                 $user = decrypt(urldecode($user));
  30.                 $pass = decrypt(urldecode($pass));
  31.                 unset($_POST['pA_encrypted']);
  32.             }
  33.             return $this->Login($user, $pass);
  34.         } else {
  35.             // There is not FreeDL support yet, due to lack of "public" downloadable links
  36.             is_present($this->page, 'You need Premium membership to download', 'Only Premium users can download this file.');
  37.             html_error('FreeDL Support Not Added Yet, Please Report Any Link Which Supports It On The Forum.');
  38.         }
  39.     }
  40.  
  41.     private function PremiumDL() {
  42.         $page = $this->GetPage($this->link, $this->cookie);
  43.  
  44.         if (!preg_match('@/get/[\w\-\.%]+/@', $page, $redir)) html_error('PremiumDL Error: Redirect not Found.');
  45.         $page = $this->GetPage($this->baseUrl . $redir[0], $this->cookie);
  46.  
  47.         if (!preg_match('@/dl/gpl/[\w\-\.%]+/@', $page, $redir)) html_error('PremiumDL Error: Redirect 2 not Found.');
  48.         $page = $this->GetPage($this->baseUrl . $redir[0], $this->cookie);
  49.         $reply = $this->json2array($page, 'PremiumDL Error');
  50.  
  51.         if (empty($reply['url']) || strpos($reply['url'], '://') === false) html_error('Download-Link Not Found.');
  52.         return $this->RedirectDownload($reply['url'], urldecode(parse_url($reply['url'], PHP_URL_PATH)));
  53.     }
  54.  
  55.     private function Login($user, $pass) {
  56.         $lUrl = $this->baseUrl . '/login.php?return=%2F';
  57.         $hUrl = $this->baseUrl . '/';
  58.  
  59.         $post = array('act' => 'login', 'captcha_shown' => 0);
  60.         $post['user'] = urlencode($user);
  61.         $post['pass'] = urlencode($pass);
  62.  
  63.         $page = $this->GetPage($lUrl, $this->cookie, $post, $hUrl);
  64.         is_present($page, 'Username/Password can not be found', 'Login Error: Wrong Login/Password.');
  65.         $this->cookie = GetCookiesArr($page, $this->cookie);
  66.         if (empty($this->cookie['yab_logined'])) html_error('Login Error: Cookie "yab_logined" not Found.');
  67.         $this->cookie['yab_ulanguage'] = 'en';
  68.  
  69.         $page = $this->GetPage($hUrl, $this->cookie, 0, $lUrl);
  70.         is_notpresent($page, '<span class="expire-date', 'Login Error: Account Isn\'t Premium?');
  71.  
  72.         return $this->PremiumDL();
  73.     }
  74. }
  75.  
  76. //[21-01-2017] Rewritten by Th3-822.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement