Advertisement
Th3-822

[rapidleech][d][freedl] filesflash_com.php

Jun 15th, 2014
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.51 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit();
  6. }
  7.  
  8. class filesflash_com extends DownloadClass {
  9.     private $page, $cookie;
  10.     public function Download($link) {
  11.         $this->DLregexp = '@https?://(?:[\w\-]+\.)+filesflash\.(?:com|net)(?:\:\d+)?/\w{32}/\w{32}/[^\'\"\t<>\r\n]+@i';
  12.         $this->cookie = array();
  13.  
  14.         $link = parse_url($link);
  15.         $link['host'] = 'filesflash.com';
  16.         if (!empty($link['port']) && !in_array($link['port'], array(80, 443))) $link['port'] = (strtolower($link['scheme']) == 'https' ? 443 : 80);
  17.         $link = rebuild_url($link);
  18.  
  19.         $this->link = $GLOBALS['Referer'] = $link;
  20.         if (empty($_POST['step']) || $_POST['step'] != '1') {
  21.             $this->page = $this->GetPage($this->link, $this->cookie);
  22.             is_present($this->page, 'That file has been deleted.');
  23.             is_present($this->page, 'That is not a valid url.', 'Error: Invalid Link?.');
  24.         }
  25.  
  26.         $this->FreeDL();
  27.     }
  28.  
  29.     private function FreeDL() {
  30.         if (!empty($_POST['step']) && $_POST['step'] == '1') {
  31.             if (!empty($_POST['cookie'])) $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
  32.             if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
  33.             if (empty($_POST['recaptcha_challenge_field'])) html_error('Empty reCAPTCHA challenge.');
  34.  
  35.             $post = array();
  36.             $post['token'] = $_POST['token'];
  37.             $post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
  38.             $post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
  39.             $post['submit'] = 'Submit';
  40.  
  41.             $page = $this->GetPage('http://filesflash.com/freedownload.php', $this->cookie, $post);
  42.  
  43.             is_present($page, 'Your IP address is already downloading another link.');
  44.             if (stripos($page, 'google.com/recaptcha/api/') !== false || stripos($page, 'recaptcha.net/') !== false) html_error('Wrong captcha entered.');
  45.  
  46.             if (!preg_match($this->DLregexp, $page, $dlink)) html_error('Error: Download link not found.');
  47.             if (!preg_match('@\scount\s*=\s*(\d+)\s*;@i', $page, $wait)) html_error('Error: Countdown not found.');
  48.             if ($wait[1] > 0) $this->CountDown($wait[1]);
  49.  
  50.             return $this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH))));
  51.         }
  52.         $this->cookie = GetCookiesArr($this->page, $this->cookie);
  53.  
  54.         $post = array();
  55.         $post['token'] = urlencode(cut_str($this->page, 'name="token" value="', '"')) or html_error('Download Token not Found.');
  56.         $post['freedl'] = urlencode(cut_str($this->page, 'name="freedl" value="', '"')) or $post['submit'] = '+Start+free+download+';
  57.  
  58.         $page = $this->GetPage('http://filesflash.com/freedownload.php', $this->cookie, $post);
  59.  
  60.         is_present($page, 'Your IP address is already downloading another link.');
  61.  
  62.         $data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
  63.         $data['step'] = 1;
  64.         $data['token'] = $post['token'];
  65.  
  66.         // Modified regexp
  67.         if (!preg_match('@https?://(?:[\w\-]+\.)?(?:google\.com/recaptcha/api|recaptcha\.net)/(?:challenge|noscript)\?(?:[^\'\"<>&]+&(?:amp;)?)*k=([\w\.\-]+)@i', $page, $reCaptcha)) html_error('reCAPTCHA not found.');
  68.  
  69.         $this->reCAPTCHA($reCaptcha[1], $data);
  70.         exit;
  71.     }
  72.  
  73.     public function CheckBack($header) {
  74.         if (stripos($header, "\nContent-Type: text/html") !== false) {
  75.             global $fp, $sFilters;
  76.             if (empty($fp) || !is_resource($fp)) html_error('[filesflash_com] Cannot check download error.');
  77.             if (empty($sFilters)) $sFilters = array();
  78.             if (in_array('dechunk', stream_get_filters()) && empty($sFilters['dechunk'])) $sFilters['dechunk'] = stream_filter_append($fp, 'dechunk', STREAM_FILTER_READ);
  79.             $body = stream_get_contents($fp);
  80.             if (empty($sFilters['dechunk']) && stripos($header, "\nTransfer-Encoding: chunked") !== false && function_exists('http_chunked_decode')) {
  81.                 $dechunked = http_chunked_decode($body);
  82.                 if ($dechunked !== false) $body = $dechunked;
  83.                 unset($dechunked);
  84.             }
  85.             is_present($body, 'Your IP address is not valid for this link.', '[filesflash_com] Your IP address is not valid for this link.');
  86.             is_present($body, 'Your IP address is already downloading another link.', '[filesflash_com] Your IP address is already downloading another link.');
  87.             is_present($body, 'Your link has expired.', '[filesflash_com] Your link has expired.');
  88.             is_present($body, 'Interrupted free downloads cannot be resumed.', '[filesflash_com] Interrupted free downloads cannot be resumed.');
  89.             html_error('[filesflash_com] Unknown download error.');
  90.         }
  91.     }
  92. }
  93.  
  94. // [15-6-2014]  Written by Th3-822. (FreeDl only.)
  95.  
  96. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement