PageRenderTime 60ms CodeModel.GetById 34ms RepoModel.GetById 1ms app.codeStats 0ms

/hosts/download/uploading_com.php

https://github.com/gartz/RapidLeetch
PHP | 157 lines | 130 code | 26 blank | 1 comment | 16 complexity | 7ca7a894108a5c19283c96c25e08064e MD5 | raw file
  1. <?php
  2. if (! defined ( 'RAPIDLEECH' ))
  3. {
  4. require_once ("index.html");
  5. exit ();
  6. }
  7. class uploading_com extends DownloadClass
  8. {
  9. public function Download($link)
  10. {
  11. global $premium_acc;
  12. if (($_REQUEST ["premium_acc"] == "on" && $_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"]) ||
  13. ($_REQUEST ["premium_acc"] == "on" && $premium_acc ["uploading"] ["user"] && $premium_acc ["uploading"] ["pass"]))
  14. {
  15. $this->DownloadPremium($link);
  16. }
  17. else
  18. {
  19. $this->DownloadFree($link);
  20. }
  21. }
  22. private function DownloadFree( $link )
  23. {
  24. global $Referer;
  25. $Referer = $link;
  26. $page = $this->GetPage($link);
  27. $fileID = trim ( cut_str($page,'file_id" value="','"') );
  28. $code = trim ( cut_str($page,'code" value="','"') );
  29. $action = trim ( cut_str($page,'action" value="','"') );
  30. $Href_1 = trim ( cut_str($page,'form action="http://uploading.com/files','"') );
  31. $Href_1 = "http://uploading.com/files".$Href_1;
  32. $cookie = GetCookies($page);
  33. $temp = cut_str($page,'<div class="c_1','</div>');
  34. $FileName = trim(cut_str($temp,'<h2>','</h2>'));
  35. is_present($page, "Sorry, the file requested by you does not exist on our servers.");
  36. is_present($page, "We are sorry, the file was removed either by its owner or due to the complaint received" );
  37. if (stristr ( $page, "Sorry, you can download only one file per" ))
  38. {
  39. $minutes = trim ( cut_str ( $page, "Sorry, you can download only one file per ", " minutes." ) );
  40. if ($minutes)
  41. {
  42. html_error ( "Download limit exceeded. Sorry, you can download only one file per <font color=black><span id='waitTime'>$minutes</span></font> minutes.Please try again later or acquire a premium membership.", 0 );
  43. }
  44. else
  45. {
  46. html_error ( "Download limit exceeded. Please try again later or acquire a premium membership.", 0 );
  47. }
  48. }
  49. $post = Array();
  50. $post["action"] = $action;
  51. $post["file_id"] = $fileID;
  52. $post["code"] = $code;
  53. $page = $this->GetPage( $Href_1, $cookie, $post, $Referer );
  54. is_present($page, "Requested file not found");
  55. preg_match_all('/start_timer\((\d+)\)/i', $page,$tm);
  56. $count = trim ( $tm[1][0] );
  57. insert_timer( $count, "Waiting link timelock", "", true );
  58. $tid=str_replace(".","12",microtime(true));
  59. $sUrl="http://uploading.com/files/get/?JsHttpRequest=".$tid."-xml";
  60. $code = trim( cut_str( $page, 'code: "', '",' ) );
  61. unset($post);
  62. $post["file_id"]=$fileID;
  63. $post["code"] = $code;
  64. $post["action"]="get_link";
  65. $post["pass"]="";
  66. $page = $this->GetPage( $sUrl, $cookie, $post, $Referer );
  67. //$dUrl=str_replace("\\","",cut_str($page,'answer": { "link": "','"'));
  68. $dUrl = str_replace("\\","",cut_str($page,'link": "','"'));
  69. if ($dUrl=="") {
  70. html_error("Download url error , Please wait for some minute and reattempt",0);
  71. }
  72. $this->RedirectDownload( $dUrl, $FileName, $cookie, 0, $Referer );
  73. exit ();
  74. }
  75. private function DownloadPremium( $link )
  76. {
  77. global $premium_acc, $Referer;
  78. $tid=str_replace(".","12",microtime(true));
  79. $loginUrl = "http://uploading.com/general/login_form/?JsHttpRequest=".$tid."-xml";
  80. $usrEmail = "";
  81. $post=array();
  82. $usrEmail = $_GET ["premium_user"] ? $_GET ["premium_user"] : $premium_acc ["uploading"] ["user"];
  83. $post["email"] = $usrEmail;
  84. $post["password"]= $_GET ["premium_pass"] ? $_GET ["premium_pass"] : $premium_acc ["uploading"] ["pass"];
  85. $page = $this->GetPage($loginUrl, 0, $post, 'http://uploading.com/login/' );
  86. $cookie=GetCookies($page);
  87. if(strpos($cookie,"error=") != false)
  88. {
  89. html_error("Login Failed , Bad username/password combination.",0);
  90. }
  91. $page = $this->GetPage( 'http://uploading.com/', $cookie, 0, 'http://uploading.com/login/' );
  92. if( !strpos( $page, $usrEmail ) )
  93. {
  94. html_error("Login Failed , Bad username/password combination.",0);
  95. }
  96. $page = $this->GetPage( $link, $cookie, 0, $Referer );
  97. $fileID = cut_str($page,"get_link', file_id: ",",");
  98. $code = trim( cut_str( $page, 'code: "', '",' ) );
  99. $Url = parse_url( $link );
  100. $tmp = basename($Url["path"]);
  101. $FileName = str_replace(".html","",$tmp);
  102. $tid = str_replace(".","12",microtime(true));
  103. $sUrl = "http://uploading.com/files/get/?JsHttpRequest=".$tid."-xml";
  104. unset($post);
  105. $post["file_id"]=$fileID;
  106. $post["code"] = $code;
  107. $post["action"] = "get_link";
  108. $page = $this->GetPage( $sUrl, $cookie, $post, $Referer );
  109. $dUrl = str_replace("\\","",cut_str($page,'link": "','"'));
  110. if ( $dUrl=="" )
  111. {
  112. html_error("Download url error , Please reattempt",0);
  113. }
  114. $this->RedirectDownload( $dUrl, $FileName, $cookie, 0, $Referer );
  115. exit ();
  116. }
  117. }
  118. /**************************************************\
  119. WRITTEN by kaox 24-may-2009
  120. UPDATE by kaox 29-nov-2009
  121. UPDATE by rajmalhotra 20 Jan 2010
  122. UPDATE by rajmalhotra Fix for downloading from Premium Accounts 23 Jan 2010 and converted in OOP's format
  123. Fixed by rajmalhotra Fix for downloading from Free and Premium Accounts 07 Feb 2010. Basically fix changes due to change in Site
  124. \**************************************************/
  125. ?>