Advertisement
Th3-822

[rapidleech][d] uptobox_com.php

Jul 5th, 2013
1,660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.00 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit();
  6. }
  7.  
  8. if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
  9. require_once(HOST_DIR . 'download/GenericXFS_DL.php');
  10.  
  11. class uptobox_com extends GenericXFS_DL {
  12.     public $pluginVer = 23;
  13.     public function Download($link) {
  14.         $this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
  15.         $this->cname = 'xfss'; // Session cookie name
  16.         $this->sslLogin = true; // Force https on login.
  17.         $this->cookieSave = true; // Save login cookies to file. (For hosts that limit/bans repeated logins)
  18.         $this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
  19.         $this->unescaper = false; // Enable JS unescape decoder.
  20.  
  21.         // Custom link-check error messages
  22.         $errMsgs = array('The file you were looking for could not be found',
  23.                 'The file was removed by administrator',
  24.                 'Unfortunately, the file you want is not available.',
  25.                 'Sorry, Uptobox.com is not available in your country'
  26.         );
  27.  
  28.         $link = str_ireplace('uptostream.com', 'uptobox.com', $link);
  29.         $this->Start($link, $errMsgs);
  30.     }
  31.  
  32.     protected function findCountdown() {
  33.         if (preg_match('@data-remaining-time=\'(\d+)\'@i', $this->page, $count)) {
  34.             if ($count[1] > 0) $this->CountDown($count[1] + 2);
  35.             return true;
  36.         }
  37.         return false;
  38.     }
  39.  
  40.     // FreeDL is totally different now, so it needs it's own function
  41.     protected function FreeDL($step = 1) {
  42.         $this->page = $this->GetPage($this->link, $this->cookie);
  43.         $this->cookie = GetCookiesArr($this->page, $this->cookie);
  44.  
  45.         if (!$this->testDL()) {
  46.             if (!preg_match('@name=\'waitingToken\'\s+value=\'([\w\-]+)\'@i', $this->page, $token)) {
  47.                 if (preg_match('@wait\s+(?:\d+ \w+,?\s){0,2}\d+ \w+ to launch a new download@i', $this->page, $err)) html_error('Error: You need to ' . strip_tags($err[0]));
  48.                 return html_error('FreeDL Token Not Found.');
  49.             }
  50.             if (!$this->findCountdown()) html_error('CountDown not Found.');
  51.  
  52.             $this->page = $this->GetPage($this->link, $this->cookie, array('waitingToken' => $token[1]));
  53.             $this->cookie = GetCookiesArr($this->page, $this->cookie);
  54.  
  55.             if (!$this->testDL()) {
  56.                 return html_error('FreeDL Download Link not Found.');
  57.             }
  58.         }
  59.         return true;
  60.     }
  61.  
  62.     // Full login url, just in case.
  63.     protected function sendLogin($post) {
  64.         return $this->GetPage('https://uptobox.com/?op=login&referer=homepage', $this->cookie, $post, 'https://uptobox.com/?op=login&referer=homepage');
  65.     }
  66.  
  67.     protected function isAccPremium($page) {
  68.         if (stripos($page, 'Free member') === false) return true;
  69.         else return false;
  70.     }
  71.  
  72.     protected function checkLogin($page) {
  73.         is_present($page, 'You are trying to log in from a different country', 'Login Failed: Login Blocked By IP, Check Account Email And Follow The Steps To Add IP to Whitelist.');
  74.         return parent::checkLogin($page);
  75.     }
  76. }
  77.  
  78. // Written by Th3-822.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement