Advertisement
Th3-822

[rapidleech][d] 1fichier_com.php

Apr 8th, 2014
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.88 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit;
  6. }
  7.  
  8. class d1fichier_com extends DownloadClass {
  9.     private $page, $cookie = array('LG' => 'en'), $pA;
  10.     public function Download($link) {
  11.         $this->LnkRegexp = '@https?://(?:www\.)?((?:1fichier|alterupload|desfichiers|dfichiers|pjointe|tenvoi|dl4free)\.com|(?:cjoint|piecejointe)\.net|mesfichiers\.org|megadl\.fr)/\?([\w\-]+)@i';
  12.  
  13.         $link = preg_replace('@//([\w\-]{4,})\.((?:1fichier|alterupload|desfichiers|dfichiers|pjointe|tenvoi|dl4free)\.com|(?:cjoint|piecejointe)\.net|mesfichiers\.org|megadl\.fr)/[^\r\n\t\'\"<>]*$@i', '//$2/?$1', $link); // Let's support old links by now
  14.  
  15.         $link = parse_url($link);
  16.         $link['scheme'] = 'https';
  17.         $link = rebuild_url($link);
  18.  
  19.         if (!preg_match($this->LnkRegexp, $link, $fid)) html_error('Invalid link?.');
  20.         $this->domain = $fid[1];
  21.         $this->link = $Referer = $fid[0];
  22.         $this->fid = $fid[2];
  23.  
  24.         $this->DLRegexp = '@https?://\w+-\w+\.((?:1fichier|alterupload|desfichiers|dfichiers|pjointe|tenvoi|dl4free)\.com|(?:cjoint|piecejointe)\.net|mesfichiers\.org|megadl\.fr)/(?:\w+'.preg_quote($this->fid).'|\w\d+)(/[^\s\'\"<>]*)?@i';
  25.  
  26.         if (empty($_POST['step'])) {
  27.             $this->page = $this->GetPage($this->link, $this->cookie);
  28.             is_present($this->page, 'The requested file has been deleted because was not downloaded within', 'File was Removed by Inactivity.');
  29.             is_present($this->page, 'The requested file has been deleted following an abuse request', 'File was Removed due to Abuse.');
  30.             is_present($this->page, 'The requested file could not be found', 'File not Found.');
  31.             $this->cookie = GetCookiesArr($this->page, $this->cookie);
  32.  
  33.             if (preg_match($this->DLRegexp, $this->page, $dl)) return $this->RedirectDownload($dl[0], (empty($dl[2]) ? 'T8_1f_d1' : urldecode(parse_url($dl[0], PHP_URL_PATH))));
  34.         }
  35.  
  36.         $this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
  37.         if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['1fichier_com']['user']) && !empty($GLOBALS['premium_acc']['1fichier_com']['pass']))))) {
  38.             $user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['1fichier_com']['user']);
  39.             $pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['1fichier_com']['pass']);
  40.             if ($this->pA && !empty($_POST['pA_encrypted'])) {
  41.                 $user = decrypt(urldecode($user));
  42.                 $pass = decrypt(urldecode($pass));
  43.                 unset($_POST['pA_encrypted']);
  44.             }
  45.             return $this->Login($user, $pass);
  46.         } else return $this->FreeDL();
  47.     }
  48.  
  49.     private function FreeDL() {
  50.         $post = array('submit' => 'Download');
  51.         $page = $this->GetPage($this->link, $this->cookie, $post);
  52.         is_present($page, 'you can only download one file at a time');
  53.         $this->cookie = GetCookiesArr($page, $this->cookie);
  54.  
  55.         if (preg_match($this->DLRegexp, $page, $dl)) return $this->RedirectDownload($dl[0], (empty($dl[2]) ? 'T8_1f_f2' : urldecode(parse_url($dl[0], PHP_URL_PATH))));
  56.  
  57.         is_present($page, 'you must wait between downloads', 'You must wait 15 minutes between downloads');
  58.  
  59.         if (!preg_match('@[\s,;]var\s+count\s*=\s*(\d+)\s*;@i', $page, $cD)) html_error('Countdown not found.');
  60.         if ($cD[1] > 0) $this->CountDown($cD[1]);
  61.  
  62.         $post = array();
  63.         $post['submit'] = cut_str($this->page, 'name="submit" value="', '"');
  64.         $post['t'] = cut_str($this->page, 'name="t" value="', '"');
  65.         if (empty($post['submit'])) $post['submit'] = 'Show the download link';
  66.         if (empty($post['t'])) html_error('Form data not found.');
  67.  
  68.         $page = $this->GetPage($this->link, $this->cookie, $post);
  69.         $this->cookie = GetCookiesArr($page, $this->cookie);
  70.  
  71.         if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download Link Not Found.');
  72.  
  73.         return $this->RedirectDownload($dl[0], (empty($dl[2]) ? 'T8_1f_f1' : urldecode(parse_url($dl[0], PHP_URL_PATH))));
  74.     }
  75.  
  76.     private function PremiumDL() {
  77.         $page = $this->GetPage($this->link, $this->cookie);
  78.         $this->cookie = GetCookiesArr($page, $this->cookie);
  79.  
  80.         is_present($page, 'Premium status should not be used on professional services. Use download credits.'); // IP Ban?
  81.         if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download-Link Not Found.');
  82.  
  83.         return $this->RedirectDownload($dl[0], (empty($dl[2]) ? 'T8_1f_pr' : urldecode(parse_url($dl[0], PHP_URL_PATH))));
  84.     }
  85.  
  86.     private function Login($user, $pass) {
  87.         $purl = 'https://'.$this->domain.'/';
  88.  
  89.         $post = array();
  90.         $post['mail'] = urlencode($user);
  91.         $post['pass'] = urlencode($pass);
  92.         $post['lt'] = 'on';
  93.         $post['restrict'] = 'on';
  94.         $post['valider'] = 'Send';
  95.  
  96.         $page = $this->GetPage($purl.'login.pl', $this->cookie, $post, $purl);
  97.         $this->cookie = GetCookiesArr($page, $this->cookie);
  98.  
  99.         is_present($page, 'Invalid email address');
  100.         is_present($page, 'Invalid username or password', 'Login Failed: Email/Password incorrect.');
  101.  
  102.         $page = $this->GetPage($purl, $this->cookie, 0, $purl.'login.pl');
  103.         is_notpresent($page, 'logout.pl">Logout', 'Login Error.');
  104.         if (stripos($page, 'https://img.1fichier.com/icons/etoile.png') === false) {
  105.             $this->changeMesg(lang(300).'<br /><b>Account isn\\\'t premium</b><br />Using it as member.');
  106.             $this->page = $this->GetPage($this->link, $this->cookie);
  107.             $this->cookie = GetCookiesArr($this->page, $this->cookie);
  108.             return $this->FreeDL();
  109.         }
  110.  
  111.         return $this->PremiumDL();
  112.     }
  113.  
  114.     // As some users doesn't have support por https downloads, let's switch to http
  115.     public function RedirectDownload($link, $FileName, $cookie = 0, $post = 0, $referer = 0, $force_name = 0, $auth = 0, $addon = array()) {
  116.         $link = parse_url($link);
  117.         $link['scheme'] = 'http';
  118.         $link = rebuild_url($link);
  119.         return parent::RedirectDownload($link, $FileName, $cookie, $post, $referer, $force_name, $auth, $addon);
  120.     }
  121. }
  122.  
  123. //[08-4-2014] Written by Th3-822.
  124. //[18-4-2014] Fixed Link Regexp. - Th3-822
  125. //[17-12-2014] Un-tested fixes for changes at the site. - Th3-822
  126.  
  127. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement