Advertisement
Th3-822

[rapidleech][d][freedl] trainbit_com

May 14th, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.74 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit;
  6. }
  7.  
  8. class trainbit_com extends DownloadClass {
  9.     private $page, $DLRegexp = '@https?://tb\d+\.trainbit\.com(?::\d+)?/files/\d+/\w+/[^\t\r\n\'\"<>]*@i';
  10.     public function Download($link) {
  11.         if (!preg_match('@https?://trainbit\.com/files/(\d+)@i', str_ireplace('://www.', '://', $link), $fid)) html_error('Invalid link?.');
  12.         $this->link = $GLOBALS['Referer'] = $fid[0] . '/';
  13.         $this->fid = $fid[1];
  14.  
  15.         $this->page = $this->GetPage($this->link);
  16.         is_present($this->page, 'Desired file is removed.', 'File Not Found.');
  17.  
  18.         return $this->FreeDL();
  19.     }
  20.  
  21.     private function FreeDL() {
  22.         $post = array();
  23.         $post['__VIEWSTATE'] = urlencode(cut_str($this->page, '="__VIEWSTATE" value="', '"')) or html_error('__VIEWSTATE Token Not Found.');
  24.         $post['__VIEWSTATEGENERATOR'] = urlencode(cut_str($this->page, '="__VIEWSTATEGENERATOR" value="', '"')) or html_error('__VIEWSTATEGENERATOR Token Not Found.');
  25.         $post['__EVENTVALIDATION'] = urlencode(cut_str($this->page, '="__EVENTVALIDATION" value="', '"')) or html_error('__EVENTVALIDATION Token Not Found.');
  26.         $post['btnDownload'] = 'Get%20Link';
  27.  
  28.         /* Longer Regex: '@<div\s+id="indicator">(?>.*?<h5[^>]+?>)\s*(\d+)\s*</h5>(?>.*?</div>)@si' */
  29.         if (!preg_match('@<h5(?:\s[^>]+)?>\s*(\d+)\s*</h5>@i', $this->page, $count)) html_error('Countdown Not Found.');
  30.         if ($count[1] > 0) $this->CountDown($count[1] + 2);
  31.  
  32.         $page = $this->GetPage($this->link, 0, $post);
  33.  
  34.         if (!preg_match($this->DLRegexp, $page, $DL)) {
  35.             textarea($this->page);
  36.             textarea($page);
  37.             html_error('Download-Link Not Found.');
  38.         }
  39.         return $this->RedirectDownload($DL[0], 'trainbit_placeholder_name');
  40.     }
  41. }
  42.  
  43. // [14-5-2016] Written by Th3-822.
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement