/hosts/download/ziddu_com.php

https://gitlab.com/dkiller1/rapidleech · PHP · 76 lines · 61 code · 8 blank · 7 comment · 14 complexity · 700dadeebd1c47adbd243b2d938e4eee MD5 · raw file

  1. <?php
  2. if(!defined('RAPIDLEECH')) {
  3. require_once ('index.html');
  4. exit();
  5. }
  6. class ziddu_com extends DownloadClass {
  7. public function Download($link) {
  8. if ($_REQUEST['step'] == '1') {
  9. $post['fid'] = $_POST['fid'];
  10. $post['tid'] = urlencode($_POST['tid']);
  11. $post['securitycode'] = $_POST['captcha'];
  12. $post['fname'] = $_POST['fname'];
  13. $post['Keyword'] = 'Ok';
  14. $post['submit'] = $_POST['submit'];
  15. $dlink = urldecode($_POST['link']);
  16. $cookie = urldecode($_POST['cookie']);
  17. $Referer = urldecode($_POST['referer']);
  18. $filename = $_POST['fname'];
  19. $this->RedirectDownload($dlink, $filename, $cookie, $post, $Referer);
  20. exit();
  21. } else {
  22. $page = $this->GetPage($link);
  23. is_present($page, "/errortracking.php?msg=File not found", "File not found");
  24. if (preg_match('@Location: (http:\/\/[^\r\n]+)@i', $page, $redir)) {
  25. $link = trim($redir[1]);
  26. $page = $this->GetPage($link);
  27. }
  28. $cookie = GetCookies($page);
  29. if (!preg_match('%<form action="((http:\/\/[^\/]+)\/[^"]+)" method="POST"%', $page, $fr)) html_error('Error [Post Link not found!]');
  30. $rlink = trim($fr[1]);
  31. $server = trim($fr[2]);
  32. if (!preg_match_all('%<input type="hidden" name="([^"]+)" id="([^"]+)" value="([^"]+)?" \/>%', $page, $one) || !preg_match_all('%<input type="submit" name="([^"]+)" value="([^"]+)" \/>%', $page, $two)) html_error('Error Post Data 1 not found!');
  33. $match = array_merge(array_combine($one[1], $one[3]), array_combine($two[1], $two[2]));
  34. $post = array();
  35. foreach ($match as $k => $v) {
  36. $post[$k] = $v;
  37. }
  38. $page = $this->GetPage($rlink, $cookie, $post, $link);
  39. is_present($page, "File not found");
  40. $form = cut_str($page, '<form name="securefrm"', '</form>');
  41. if (!preg_match('@action="([^"]+)" method="post"@', $form, $dl)) html_error('Error [Download Link not found]');
  42. $dlink = $server.$dl[1];
  43. if (!preg_match_all('%<input type="(hidden|submit)" name="([^"]+)" id="([^"]+)" value="([^"]+)?"\/?>%', $form, $match)) html_error('Error [Post Data 2 not found!]');
  44. $match = array_combine($match[2], $match[4]);
  45. if (!preg_match('%mg src="([^"]+)"%', $form, $c)) html_error('Error [Captcha Data not found!]');
  46. // download captcha image
  47. $cap = $this->GetPage($server.$c[1], $cookie);
  48. $capt_img = substr($cap, strpos($cap, "\r\n\r\n") + 4);
  49. $imgfile = DOWNLOAD_DIR . "ziddu_captcha.png";
  50. if (file_exists($imgfile)) unlink($imgfile);
  51. if (empty($capt_img) || !write_file($imgfile, $capt_img)) html_error("Error getting CAPTCHA image.");
  52. // Captcha img downloaded
  53. $data = array_merge($this->DefaultParamArr($dlink, $cookie, $rlink), $match);
  54. $data['step'] = '1';
  55. $this->EnterCaptcha($imgfile, $data);
  56. exit();
  57. }
  58. }
  59. public function CheckBack($header) {
  60. is_notpresent($header, 'ontent-Disposition: attachment', 'You have entered wrong captcha!');
  61. }
  62. }
  63. /*
  64. * WRITTEN by kaox 17-sep-2009
  65. * UPDATE by kaox 15-sep-2010
  66. * CONVERTED INTO OOP FORMAT by Ruud v.Tony 15-02-2012
  67. */
  68. ?>