Advertisement
Titeuf

[Rapidleech][DL] lumfile_com.php

Nov 28th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.35 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4. require_once ('index.html');
  5. exit();
  6. }
  7.  
  8. class lumfile_com extends DownloadClass {
  9. private $page, $cookie;
  10. public function Download($link) {
  11. global $premium_acc;
  12. $this->cookie = array('lang' => 'english');
  13. $this->page = $this->GetPage($link, $this->cookie);
  14. is_present($this->page, 'The file you were looking for could not be found');
  15. is_present($this->page, 'No such file with this filename', 'Error: Invalid filename, check your link and try again.');
  16.  
  17. if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['lumfile_com']['user']) && !empty($premium_acc['lumfile_com']['pass'])))) $this->Login($link);
  18. else $this->FreeDL($link);
  19. }
  20.  
  21. private function FreeDL($link) {
  22. $page2 = cut_str($this->page, 'Form method="POST" action=', '</form>'); //Cutting page
  23. $post = array();
  24. $post['op'] = cut_str($page2, 'name="op" value="', '"');
  25. $post['usr_login'] = (empty($this->cookie['xfss'])) ? '' : $this->cookie['xfss'];
  26. $post['id'] = cut_str($page2, 'name="id" value="', '"');
  27. $post['fname'] = cut_str($page2, 'name="fname" value="', '"');
  28. $post['referer'] = '';
  29. $post['method_free'] = cut_str($page2, 'name="method_free" value="', '"');
  30.  
  31. $page = $this->GetPage($link, $this->cookie, $post);
  32. if (preg_match('@You have to wait (?:\d+ \w+,\s)?\d+ \w+ till next download@', $page, $err)) html_error('Error: '.$err[0]);
  33.  
  34. $page2 = cut_str($page, '<form name="F1" method="POST"', '</form>'); //Cutting page
  35. $post = array();
  36. $post['op'] = cut_str($page2, 'name="op" value="', '"');
  37. $post['id'] = cut_str($page2, 'name="id" value="', '"');
  38. $post['rand'] = cut_str($page2, 'name="rand" value="', '"');
  39. $post['referer'] = '';
  40. $post['method_free'] = cut_str($page2, 'name="method_free" value="', '"');
  41.  
  42. if (!preg_match_all("@<span style='[^\'>]*padding-left\s*:\s*(\d+)[^\'>]*'[^>]*>((?:&#\w+;)|(?:\d))</span>@i", $page2, $spans)) html_error('Error: Cannot decode captcha.');
  43. $spans = array_combine($spans[1], $spans[2]);
  44. ksort($spans, SORT_NUMERIC);
  45. $captcha = '';
  46. foreach ($spans as $digit) $captcha .= $digit;
  47. $post['code'] = html_entity_decode($captcha);
  48.  
  49. $post['down_script'] = 1;
  50.  
  51. if (preg_match('@<span id="countdown_str"[^>]*>[^<>]+<span[^>]*>(\d+)</span>[^<>]+</span>@i', $page2, $count) && $count[1] > 0) $this->CountDown($count[1]);
  52.  
  53. $page = $this->GetPage($link, $this->cookie, $post);
  54.  
  55. is_present($page, '>Skipped countdown', 'Error: Skipped countdown?.');
  56. is_present($page, '>Wrong captcha<', 'Error: Unknown error after sending decoded captcha.'); // The sended captcha it's correct... But sometimes it's showed.
  57. if (preg_match('@You can download files up to \d+ [KMG]b only.@i', $page, $err)) html_error('Error: '.$err[0]);
  58.  
  59. if (!preg_match('@https?://[^/\r\n]+/(?:(?:files)|(?:dl?))/[^\'\"\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download link not found.');
  60.  
  61. $FileName = urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)));
  62. $this->RedirectDownload($dlink[0], $FileName);
  63. }
  64.  
  65. private function PremiumDL($link) {
  66. $page = $this->GetPage($link, $this->cookie);
  67. if (!preg_match('@https?://[^/\r\n]+/(?:(?:files)|(?:dl?))/[^\'\"\s\t<>\r\n]+@i', $page, $dlink)) {
  68. $page2 = cut_str($page, '<form name="F1" method="POST"', '</form>'); //Cutting page
  69.  
  70. $post = array();
  71. $post['op'] = cut_str($page2, 'name="op" value="', '"');
  72. $post['id'] = cut_str($page2, 'name="id" value="', '"');
  73. $post['rand'] = cut_str($page2, 'name="rand" value="', '"');
  74. $post['referer'] = '';
  75. $post['method_premium'] = cut_str($page2, 'name="method_premium" value="', '"');
  76. $post['down_direct'] = 1;
  77.  
  78. $page = $this->GetPage($link, $this->cookie, $post);
  79.  
  80. if (!preg_match('@https?://[^/\r\n]+/(?:(?:files)|(?:dl?))/[^\'\"\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download-link not found.');
  81. }
  82.  
  83. $FileName = urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)));
  84. $this->RedirectDownload($dlink[0], $FileName);
  85. }
  86.  
  87. private function Login($link) {
  88. global $premium_acc;
  89. $pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false);
  90. $user = ($pA ? $_REQUEST['premium_user'] : $premium_acc['lumfile_com']['user']);
  91. $pass = ($pA ? $_REQUEST['premium_pass'] : $premium_acc['lumfile_com']['pass']);
  92.  
  93. if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.');
  94. $post = array();
  95. $post['login'] = urlencode($user);
  96. $post['password'] = urlencode($pass);
  97. $post['op'] = 'login';
  98. $post['redirect'] = '';
  99.  
  100. $purl = 'http://lumfile.com/';
  101. $page = $this->GetPage($purl, $this->cookie, $post, $purl);
  102. if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.');
  103. is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.');
  104.  
  105. $this->cookie = GetCookiesArr($page);
  106. if (empty($this->cookie['xfss'])) html_error('Login Error: Cannot find session cookie.');
  107. $this->cookie['lang'] = 'english';
  108.  
  109. $page = $this->GetPage("$purl?op=my_account", $this->cookie, 0, $purl);
  110. if (stripos($page, '/?op=logout') === false && stripos($page, '/logout') === false) html_error('Login Error.');
  111.  
  112. if (stripos($page, 'Premium account expire') === false) {
  113. $this->changeMesg(lang(300).'<br /><b>Account isn\\\'t premium</b><br />Using it as member.');
  114. return $this->FreeDL($link);
  115. } else return $this->PremiumDL($link);
  116. }
  117. }
  118.  
  119. //===================== You want more Plugin? So respect the copyright, thanks! =================================
  120. // Based on the code of Th3-822, thank you my friend!
  121. // Lumfile.com Upload Plugin created by Titeuf
  122. // Instructions :
  123. // In your premium account, remember to check the direct download!
  124. // Add this to your account.php:
  125. // $premium_acc["lumfile.com"] = array('user' => 'username', 'pass' => 'yourpass');
  126. //===============================================================================================================
  127.  
  128. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement