Advertisement
Tblogger

[rapidleech][dl]oboom_com.php

Sep 17th, 2014
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.55 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.         require_once('index.html');
  5.         exit();
  6. }
  7.  
  8. class oboom_com extends DownloadClass {
  9.         private $page, $cookie;
  10.         public function Download($link) {
  11.                 global $premium_acc;
  12.  
  13.                 if (strpos($link, '#')) $link = str_replace('#', '', $link);
  14.  
  15.                 if(strpos($link, "/folder/")) {
  16.                         if (!preg_match('@https?://(www.)?oboom\.com\/folder\/([\w]{8})@i', $link, $id)) html_error('Link invalid?.');
  17.                         $link = "https://www.oboom.com/folder/$id[2]";
  18.                         return $this->Folder($link);
  19.                 }
  20.                 if (!preg_match('@https?://(www.)?oboom\.com\/([\w]{8})@i', $link, $id)) html_error('Link invalid?.');
  21.  
  22.                 $link = "https://www.oboom.com/$id[2]";
  23.  
  24.                 if (($_REQUEST["premium_acc"] == "on" && $_REQUEST["premium_user"] && $_REQUEST["premium_pass"]) || ($_REQUEST["premium_acc"] == "on" && $premium_acc["oboom_com"]["user"] && $premium_acc["oboom_com"]["pass"])) {
  25.                         $this->Login($link);
  26.         } else {
  27.                         $this->FreeDL($link);
  28.                 }
  29.         }
  30.  
  31.         private function Login($link) {
  32.                 global $premium_acc;
  33.                 $pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false);
  34.                 $user = ($pA ? $_REQUEST['premium_user'] : $premium_acc['oboom_com']['user']);
  35.                 $pass = ($pA ? $_REQUEST['premium_pass'] : $premium_acc['oboom_com']['pass']);
  36.  
  37.                 if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.');
  38.  
  39.                 $mysalt = strrev($pass);
  40.  
  41.                 $hash = $this->pbkdf2('sha1', $pass, $mysalt, 1000, 16);
  42.  
  43.                 $post = array();
  44.                 $post = array(
  45.                         'auth' => $user,
  46.                         'pass' => $hash,
  47.                         'source' => '/#app',
  48.                 );
  49.  
  50.                 $page = $this->GetPage('https://www.oboom.com/1/login', array('lang' => 'EN',), $post);
  51.                 list ($header, $page) = array_map('trim', explode("\r\n\r\n", $page, 2));
  52.  
  53.                 $json = @json_decode($page, true);
  54.  
  55.                 if ($json[0] == 200) {
  56.                         $this->cookie = array('user' => urlencode($json[1]['cookie']), 'lang' => 'EN',);
  57.                         $this->changeMesg(lang(300).'<br /><b>Account is premium</b><br />'.$json[1]['user']['premium']);
  58.                         return $this->PremiumDL($link);
  59.                 }
  60.  
  61.                 elseif ($json[0] == 400) html_error('Login failed: Email/Password incorrect.');
  62.  
  63.                 elseif ($json[1]['user']['premium'] == null) {
  64.                         $this->changeMesg(lang(300).'<br /><b>Account isn\\\'t premium</b><br />Using it as member.');
  65.                         return $this->FreeDL($link);
  66.                 }
  67.         }
  68.  
  69.         private function PremiumDL($link) {
  70.                 $page = $this->GetPage($link, $this->cookie);
  71.  
  72.                 if (strpos($page, '400 Bad Request')) html_error('Link invalid?.');
  73.  
  74.                 if (preg_match('@ocation: (https?://(www\.)?oboom\.com/[^\r\n]+)@i', $page, $redir)) {
  75.                         $page = $this->GetPage(trim($redir[1]), $this->cookie);
  76.                 }
  77.  
  78.                 if (!preg_match('@https?://[\w\.]+\.oboom\.com/1\.0/dlh\?ticket=[^\r\n]+@i', $page, $dlink)) {
  79.                        if (!preg_match('@Redirecting to (https?:\/\/api\.oboom\.com\/(1|1\.0)\/dl\?redirect=true&token=[^\r\n]+)@i', $page, $lik))
  80.                         {if (!preg_match('@Redirecting to /#([\w]{8})@i', $page, $redir3)) html_error('Item ID not found.');
  81.  
  82.                         $page = $this->GetPage('https://www.oboom.com/#' .trim($redir3[1]), $this->cookie);
  83.  
  84.                         if (!preg_match('@Session : "([^"]+)"@i', $page, $token)) html_error('Token not found.');
  85.  
  86.                         $page = $this->GetPage('https://api.oboom.com/1/dl', $this->cookie, array('token' => $token[1], 'item' => $redir3[1],),0);
  87.                         list ($header, $page) = array_map('trim', explode("\r\n\r\n", $page, 2));
  88.  
  89.  
  90.                         $json = @json_decode($page, true);
  91.  
  92.                         if (isset($json[0]) && $json[0] == 200) {
  93.                                 $link = trim('http://'.$json[1].'/1.0/dlh?ticket='.$json[2]);
  94.                                 if (!preg_match('@https?://[\w\.]+\.oboom\.com/1\.0/dlh\?ticket=[^\r\n]+@i', $link, $dlink)) html_error('Error: Download-link not found.');
  95.                         }}
  96.  
  97.                         elseif (isset($json[0]) && $json[0] != 200) $this->CheckErr($json[0]);
  98.                 }
  99.  
  100.                 $this->RedirectDownload($lik[1], urldecode(basename(parse_url($lik[1], PHP_URL_PATH))));
  101.  
  102.         }
  103.  
  104.         private function CheckErr($code) {      //Th3-822
  105.                 if (is_numeric($code)) {
  106.                         switch ($code) {
  107.                                 default: $msg = '*No message for this error*';break;
  108.                                 case 400: $msg = 'Bad request. You offered an invalid input parameter. See the attached error message for infos what parameter was invalid/missing and more informations.';break;
  109.                                 case 403: $msg = 'Access denied. This includes insufficient user permission to access a resource, the maximal upload filesize or IP conflicts with a token.';break;
  110.                                 case 404: $msg = 'Resource not found. The first parameter tells you what resource was not not found, the second (which is optional) why.';break;
  111.                                 case 409: $msg = 'Conflict. The requested resource has a conflict with another resource. This usually happens on file system operations like copy or move.';break;
  112.                                 case 410: $msg = 'Gone. The resource you requested is no longer available and will not come back The parameters are are the same as with 404.';break;
  113.                                 case 413: $msg = 'Request entity too large. The request is handling too much resources at once. This can happen during a cp call.';break;
  114.                                 case 421: $msg = 'Connection limit exceeded. You are downloading with too many connections at once or your IP is blocked for (the second parameter tells you how long). This error usually comes when you downloaded too much as a guest or free user.';break;
  115.                                 case 500: $msg = 'Internal server error. This should not happen but it may. See the attached error message for more informations.';break;
  116.                                 case 503: $msg = 'The service is temporary not available. You may retry later. See the parameters for infos about what is not available.';break;
  117.                                 case 507: $msg = 'At least one quota like storage space or item count reached.';break;
  118.                                 case 509: $msg = 'Bandwidth limit exceeded. You have to get more traffic to access this resource.';break;
  119.                         }
  120.                         html_error("[Error: $code] $msg.");
  121.                 }
  122.         }
  123.  
  124.         private function Folder($link) {
  125.                 $page = $this->GetPage($link);
  126.  
  127.                 if (strpos($page, '400 Bad Request')) html_error('Link invalid?.');
  128.  
  129.                 if (preg_match('@ocation: (https?://(www\.)?oboom\.com/[^\r\n]+)@i', $page, $redir)) {
  130.                         $page = $this->GetPage(trim($redir[1]));
  131.                 }
  132.  
  133.                 if (!preg_match('@Redirecting to /#folder/([\w]{8})@i', $page, $FD)) html_error('Item ID not found.');
  134.  
  135.                 $page = $this->GetPage('https://www.oboom.com/#folder/' .trim($FD[1]));
  136.  
  137.                 if (!preg_match('@Session : "([^"]+)"@i', $page, $token)) html_error('Token not found.');
  138.  
  139.                 $page = $this->GetPage('https://api.oboom.com/1/ls', 0, array('token' => $token[1], 'item' => $FD[1],));
  140.                 list ($header, $page) = array_map('trim', explode("\r\n\r\n", $page, 2));
  141.  
  142.                 if (strpos($page, '404,"item')) html_error('Empty Folder?.');
  143.  
  144.                 if (!preg_match_all('@","root"\:"\d+","id"\:"(\w+)"@i', $page, $id)) html_error('Empty Folder?.');
  145.  
  146.                 foreach ($id[1] as $id_link) $link_array[] = "https://www.oboom.com/" .$id_link;
  147.  
  148.                 $this->moveToAutoDownloader($link_array);
  149.         }
  150.  
  151.     private function FreeDL($link) {
  152.                 html_error('not support Free Download');
  153.     }
  154.  
  155.         private function pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false)
  156.         {       //https://github.com/defuse/password-hashing/blob/master/PasswordHash.php
  157.                 $algorithm = strtolower($algorithm);
  158.                 if(!in_array($algorithm, hash_algos(), true))
  159.                         trigger_error('PBKDF2 ERROR: Invalid hash algorithm.', E_USER_ERROR);
  160.                 if($count <= 0 || $key_length <= 0)
  161.                         trigger_error('PBKDF2 ERROR: Invalid parameters.', E_USER_ERROR);
  162.  
  163.                 if (function_exists("hash_pbkdf2")) {
  164.                         // The output length is in NIBBLES (4-bits) if $raw_output is false!
  165.                         if (!$raw_output) {
  166.                                 $key_length = $key_length * 2;
  167.                         }
  168.                         return hash_pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output);
  169.                 }
  170.  
  171.                 $hash_length = strlen(hash($algorithm, "", true));
  172.                 $block_count = ceil($key_length / $hash_length);
  173.  
  174.                 $output = "";
  175.                 for($i = 1; $i <= $block_count; $i++) {
  176.                         // $i encoded as 4 bytes, big endian.
  177.                         $last = $salt . pack("N", $i);
  178.                         // first iteration
  179.                         $last = $xorsum = hash_hmac($algorithm, $last, $password, true);
  180.                         // perform the other $count - 1 iterations
  181.                         for ($j = 1; $j < $count; $j++) {
  182.                                 $xorsum ^= ($last = hash_hmac($algorithm, $last, $password, true));
  183.                         }
  184.                         $output .= $xorsum;
  185.                 }
  186.  
  187.                 if($raw_output)
  188.                         return substr($output, 0, $key_length);
  189.                 else
  190.                         return bin2hex(substr($output, 0, $key_length));
  191.         }
  192.  
  193. }
  194.  
  195. // [21-4-2014]  Written by giaythuytinh176.
  196. // [17-09-2014] Fixed By Tblogger.
  197. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement