Advertisement
Th3-822

[rapidleech][d] dizzcloud_com.php

Jul 20th, 2013
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.01 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit();
  6. }
  7.  
  8. class dizzcloud_com extends DownloadClass {
  9.     private $page, $cookie;
  10.     public function Download($link) {
  11.         global $premium_acc;
  12.         $this->cookie = array();
  13.         if (!preg_match('@^https?://(?:www\.)?dizzcloud\.com/dl/(\w{7})/?@i', $link, $fid)) html_error('Invalid Link?');
  14.         $this->link = $fid[0];
  15.         $this->fid = $fid[1];
  16.  
  17.         if (empty($_POST['step']) || $_POST['step'] != '1') {
  18.             $this->page = $this->GetPage($link, $this->cookie);
  19.             is_present($this->page, '>File not found<', 'The file you were looking for could not be found');
  20.         }
  21.  
  22.         if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['dizzcloud_com']['user']) && !empty($premium_acc['dizzcloud_com']['pass'])))) $this->Login();
  23.         else $this->FreeDL();
  24.     }
  25.  
  26.     private function Get_Reply($content) {
  27.         if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
  28.         $content = ltrim($content);
  29.         if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
  30.         $cb_pos = strpos($content, '{');
  31.         $sb_pos = strpos($content, '[');
  32.         if ($cb_pos === false && $sb_pos === false) html_error('Json start braces not found.');
  33.         $sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
  34.         $content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
  35.         if (empty($content)) html_error('No json content.');
  36.         $rply = json_decode($content, true);
  37.         if ($rply === NULL) html_error('Error reading json.');
  38.         return $rply;
  39.     }
  40.  
  41.     private function FreeDL() {
  42.         if (empty($_POST['step']) || $_POST['step'] != '1') {
  43.             if (preg_match('@Next free download from your ip will be available in <b>\d+ \w+@i', $this->page, $err)) html_error($err[0].'</b>');
  44.             if (!preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $this->page, $pid)) html_error('reCAPTCHA not found.');
  45.             $this->cookie = GetCookiesArr($this->page, $this->cookie);
  46.  
  47.             $data = $this->DefaultParamArr($this->link, (empty($this->cookie)) ? 0 : encrypt(CookiesToStr($this->cookie)));
  48.             $data['step'] = '1';
  49.  
  50.             $this->reCAPTCHA($pid[1], $data);
  51.             exit;
  52.         } else {
  53.             if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
  54.             if (!empty($_POST['cookie'])) $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
  55.  
  56.             $query = array();
  57.             $query['type'] = 'recaptcha';
  58.             $query['challenge'] = urlencode($_POST['recaptcha_challenge_field']);
  59.             $query['capture'] = urlencode($_POST['recaptcha_response_field']);
  60.  
  61.             $page = $this->GetPage($this->link.'?'.http_build_query($query), $this->cookie);
  62.             $reply = $this->Get_Reply($page);
  63.             if (!empty($reply['err'])) html_error('Error: '.htmlentities($reply['err']));
  64.             if (empty($reply['href']) || !preg_match('@https?://[\w\-]+\.cloudstoreservice\.net/[^\'\"\t<>\r\n]+@i', $reply['href'], $dlink)) {
  65.                 if (!empty($reply['href']) && stripos($reply['href'], '/dl/') === 0) html_error('Expired/Used/Invalid DL Session.');
  66.                 html_error('Error: Download link not found.');
  67.             }
  68.  
  69.             $this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH))));
  70.         }
  71.     }
  72.  
  73.     private function PremiumDL() {
  74.         $page = $this->GetPage($this->link, $this->cookie);
  75.         if (!preg_match('@https?://[\w\-]+\.cloudstoreservice\.net/[^\'\"\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download-link not found.');
  76.  
  77.         $this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH))));
  78.     }
  79.  
  80.     private function Login() {
  81.         global $premium_acc;
  82.         $pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false);
  83.         $user = ($pA ? $_REQUEST['premium_user'] : $premium_acc['dizzcloud_com']['user']);
  84.         $pass = ($pA ? $_REQUEST['premium_pass'] : $premium_acc['dizzcloud_com']['pass']);
  85.  
  86.         if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.');
  87.         $post = array();
  88.         $post['email'] = urlencode($user);
  89.         $post['pass'] = urlencode($pass);
  90.  
  91.         $purl = 'http://dizzcloud.com/';
  92.         $page = $this->GetPage($purl.'login', $this->cookie, $post, $purl.'login');
  93.  
  94.         $this->cookie = GetCookiesArr($page);
  95.         if (empty($this->cookie['auth_uid']) || empty($this->cookie['auth_hash'])) html_error('Login failed: User/Password incorrect?.');
  96.  
  97.         $page = $this->GetPage($purl, $this->cookie, 0, $purl.'login');
  98.         if (stripos($page, '/logout') === false) html_error('Login Error.');
  99.  
  100.         if (stripos($page, '>Premium till') === false) {
  101.             $this->changeMesg(lang(300).'<br /><b>Account isn\\\'t premium</b><br />Using it as member.');
  102.             $this->page = $this->GetPage($this->link, $this->cookie);
  103.             return $this->FreeDL();
  104.         } else return $this->PremiumDL();
  105.     }
  106. }
  107.  
  108. // [20-7-2013]  Written by Th3-822.
  109. // [24-3-2014]  Fixed FreeDL. - Th3-822
  110.  
  111. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement