Advertisement
Th3-822

[rapidleech][d] ultramegabit_com.php

Sep 6th, 2012
933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.74 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once ('index.html');
  5.     exit();
  6. }
  7.  
  8. class ultramegabit_com extends DownloadClass {
  9.     private $page, $cookie;
  10.     public function Download($link) {
  11.         global $premium_acc;
  12.  
  13.         $this->page = $this->GetPage($link, $this->cookie);
  14.         is_present($this->page, "\r\nContent-Length: 0\r\n", 'Invalid link?');
  15.         $this->cookie = GetCookiesArr($this->page);
  16.  
  17.         if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['ultramegabit_com']['user']) && !empty($premium_acc['ultramegabit_com']['pass'])))) $this->Login($link);
  18.         else $this->FreeDL($link);
  19.     }
  20.  
  21.     private function FreeDL($link, $acc=false) {
  22.         $post = array();
  23.         $post['csrf_token'] = cut_str($this->page, 'name="csrf_token" value="', '"');
  24.         $post['encode'] = cut_str($this->page, 'name="encode" value="', '"');
  25.  
  26.         $page = $this->GetPage('http://ultramegabit.com/file/download', $this->cookie, $post);
  27.         is_present('/user/confirm', 'Your account isn\'t validated.');
  28.         if (preg_match('@/alert/delay/(\d+)@i', $page, $time)) {
  29.             $wtime = $acc ? 20 : 30;
  30.             $msg = $acc ? 'Free users' : 'Guests';
  31.             $wait = ($time[1] - time()) + ($wtime * 60);
  32.  
  33.             $this->JSCountdown($wait, 0, "$msg are only able to download 1 file every $wtime minutes");
  34.             return;
  35.         }
  36.         if (!preg_match('@https?://[^/\r\n]+/files/[^\'\"\s\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download link not found.');
  37.  
  38.         $FileName = urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)));
  39.         $this->RedirectDownload($dlink[0], $FileName);
  40.     }
  41.  
  42.     private function PremiumDL($link) {
  43.         if (!preg_match('@https?://[^/\r\n]+/files/[^\'\"\s\t<>\r\n]+@i', $this->page, $dlink)) {
  44.             $post = array();
  45.             $post['csrf_token'] = cut_str($this->page, 'name="csrf_token" value="', '"');
  46.             $post['encode'] = cut_str($this->page, 'name="encode" value="', '"');
  47.  
  48.             $page = $this->GetPage('http://ultramegabit.com/file/download', $this->cookie, $post);
  49.  
  50.             if (!preg_match('@https?://[^/\r\n]+/files/[^\'\"\s\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download-link not found.');
  51.         }
  52.  
  53.         $FileName = urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)));
  54.         $this->RedirectDownload($dlink[0], $FileName);
  55.     }
  56.  
  57.     private function Login($link) {
  58.         global $premium_acc;
  59.         $pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false);
  60.         $user = ($pA ? $_REQUEST['premium_user'] : $premium_acc['ultramegabit_com']['user']);
  61.         $pass = ($pA ? $_REQUEST['premium_pass'] : $premium_acc['ultramegabit_com']['pass']);
  62.         if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.');
  63.  
  64.         $purl = 'http://ultramegabit.com/';
  65.         $post = array();
  66.         $post['csrf_token'] = cut_str($this->page, 'name="csrf_token" value="', '"');
  67.         $post['submit'] = 'Login';
  68.         $post['return_url'] = urlencode($purl.'user/details');
  69.         $post['username'] = urlencode($user);
  70.         $post['password'] = urlencode($pass);
  71.  
  72.         $page = $this->GetPage($purl.'login', $this->cookie, $post, $purl);
  73.         is_present($page, 'Invalid username or password', 'Login failed: User/Password incorrect.');
  74.         is_notpresent($page, "\r\nContent-Length: 0\r\n", 'Login failed.');
  75.         $this->cookie = GetCookiesArr($page);
  76.  
  77.         $page = $this->GetPage($purl.'user/details', $this->cookie, 0, $purl.'login');
  78.  
  79.         $this->page = $this->GetPage($link, $this->cookie);
  80.  
  81.         if (stripos($page, '"Premium Member"') === false) {
  82.             $this->changeMesg(lang(300).'<br /><b>Account isn\'t premium</b><br />Using it as member.');
  83.             return $this->FreeDL($link, true);
  84.         } else return $this->PremiumDL($link);
  85.     }
  86. }
  87.  
  88. // [06-9-2012]  Written by Th3-822.
  89. // Pastebin, please don't delete this paste, isn't "higher spam".
  90.  
  91. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement