PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/pluginz/download/filefaster_com.php

http://rapidleech36b.googlecode.com/
PHP | 69 lines | 65 code | 4 blank | 0 comment | 8 complexity | b2f1f9efbabc3ca174a70451a198c0dd MD5 | raw file
  1. <?php
  2. if (!defined('RAPIDLEECH')) {
  3. require_once("index.html");
  4. exit;
  5. }
  6. class filefaster_com extends DownloadClass {
  7. public function Download($link) {
  8. global $Referer;
  9. $page = $this->GetPage($link);
  10. is_present($page, "No such file with this filename", "No such file with this filename");
  11. $id = cut_str($page, 'name="id" value="', '"');
  12. $FileName = cut_str($page, 'name="fname" value="', '"');
  13. $post = array();
  14. $post['op'] = "download1";
  15. $post['usr_login'] = "";
  16. $post['id'] = $id;
  17. $post['fname'] = $FileName;
  18. $post['referer'] = $link;
  19. $post['method_free'] = "Free Download";
  20. $page = $this->GetPage($link, 0, $post, $link);
  21. if (preg_match('#(\d+)</b></font></span> seconds#', $page, $wait)) {
  22. $this->CountDown($wait[1]);
  23. }
  24. if (preg_match_all("#<span style='[^\d]+(\d+)[^\d]+\d+\w+;'>\W+(\d+);</span>#", $page, $temp)) {
  25. for ($i = 0; $i < count($temp[1]) - 1; $i++) {
  26. for ($j = $i + 1; $j < count($temp[1]); $j++) {
  27. if ($temp[1][$i] > $temp[1][$j]) {
  28. $n = 1;
  29. do {
  30. $tmp = $temp[$n][$i];
  31. $temp[$n][$i] = $temp[$n][$j];
  32. $temp[$n][$j] = $tmp;
  33. $n++;
  34. } while ($n <= 2);
  35. }
  36. }
  37. }
  38. $captcha = "";
  39. foreach ($temp[2] as $value) {
  40. $captcha.=chr($value);
  41. }
  42. }
  43. $rand = cut_str($page, 'name="rand" value="', '"');
  44. unset($post);
  45. $post['op'] = "download2";
  46. $post['id'] = $id;
  47. $post['rand'] = $rand;
  48. $post['referer'] = $link;
  49. $post['method_free'] = "Free Download";
  50. $post['method_premium'] = "";
  51. $post['code'] = $captcha;
  52. $post['down_script'] = "1";
  53. $page = $this->GetPage($link, 0, $post, $link);
  54. if (!stristr($page, "Location:")) {
  55. html_error("Sorry, download link couldn't be found. Contact the author n give the link which u have this error!");
  56. }
  57. $dlink = trim(cut_str($page, "Location: ", "\n"));
  58. if (!$FileName) $FileName = basename($Url['path']);
  59. $this->RedirectDownload($dlink, $FileName, 0, 0, $link);
  60. }
  61. }
  62. //filefaster free download plugin by Ruud v.Tony 23-06-2011
  63. ?>