PageRenderTime 22ms CodeModel.GetById 11ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/hosts/filefactory_com.php

https://github.com/gartz/RapidLeetch
PHP | 101 lines | 83 code | 12 blank | 6 comment | 20 complexity | de70b04ca5bbf9b103a63ced6784c9de MD5 | raw file
  1<?php
  2if (!defined('RAPIDLEECH'))
  3  {
  4  require_once("index.html");
  5  exit;
  6  }
  7
  8
  9//Use PREMIUM?
 10if (($_GET["premium_acc"] == "on" && $_GET["premium_user"] && $_GET["premium_pass"]) || ($_GET["premium_acc"] == "on" && $premium_acc["filefactory"]["user"] && $premium_acc["filefactory"]["pass"]))
 11{
 12	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
 13	is_page($page);
 14	is_present($page, 'File Not Found', 'Error - File was not found!');
 15	$post = array();
 16	$post['email'] = $_GET["premium_user"] ? trim($_GET["premium_user"]) : $premium_acc["filefactory"]["user"]  ;
 17	$post['password'] = $_GET["premium_pass"] ? trim($_GET["premium_pass"]) : $premium_acc["filefactory"]["pass"];
 18	$post['redirect'] = $LINK;
 19	$page = geturl("www.filefactory.com", 80, "/", 0, 0, $post, 0, $_GET["proxy"], $pauth);
 20	is_page($page);
 21	if (!preg_match('%(ff_membership=.+); expires%', $page, $lcook)) html_error('Error getting login-cookie', 0);
 22	if (!preg_match('%ocation: (.+)\r\n%', $page, $redir)) html_error('Error getting redirect', 0);
 23	$Url = parse_url($redir[1]);
 24	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $lcook[1], 0, 0, $_GET["proxy"],$pauth);
 25	if (!preg_match('%ocation: (.+)\r\n%', $page, $redir2)) html_error('Error getting redirect 2', 0);
 26	$Url = parse_url($redir2[1]);
 27	$FileName = basename($Url['path']);
 28	insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&path=".urlencode($Url["path"].($Url["query"] ? "?".$Url["query"] : ""))."&referer=".urlencode($Referer)."&cookie=".urlencode($lcook[1])."&email=".($_GET["domail"] ? $_GET["email"] : "")."&partSize=".($_GET["split"] ? $_GET["partSize"] : "")."&method=".$_GET["method"]."&proxy=".($_GET["useproxy"] ? $_GET["proxy"] : "")."&saveto=".$_GET["path"]."&link=".$redir2[1].($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "").($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
 29}
 30else
 31//Use FREE instead?
 32{
 33if ($_GET["step"] == "1")
 34  {
 35 $cook = $_POST['cookie'];
 36  
 37  
 38  $post["captchaText"] = $_POST["captcha"];
 39  $post['captchaID'] = $_POST['captchaID'];
 40  
 41  $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cook, $post, 0, $_GET["proxy"],$pauth);
 42  is_page($page);
 43  //var_dump(nl2br(htmlentities($page)));exit;
 44  
 45	preg_match('/<a href="(.+?)" class="download">/', $page, $dllink);
 46	$Href = trim($dllink[1]);
 47	$Url = parse_url($Href);
 48  
 49  if (!is_array($Url))
 50    {
 51    html_error("Download link not found", 0);
 52    }
 53  
 54  $FileName = "attachment";
 55  
 56  insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&path=".urlencode($Url["path"].($Url["query"] ? "?".$Url["query"] : ""))."&referer=".urlencode($Referer)."&cookie=".urlencode($premium_cookie)."&email=".($_GET["domail"] ? $_GET["email"] : "")."&partSize=".($_GET["split"] ? $_GET["partSize"] : "")."&method=".$_GET["method"]."&proxy=".($_GET["useproxy"] ? $_GET["proxy"] : "")."&saveto=".$_GET["path"]."&link=".$_POST["link2"].($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "").($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
 57}
 58else
 59  {
 60  
 61  $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
 62  is_page($page);
 63  if (stristr($page,'ocation:')) {
 64	preg_match('/ocation: (.*)/',$page,$loc);
 65	$loc = "http://".$Url['host'].$loc[1];
 66	$Url = parse_url(trim($loc));
 67	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, 0, 0, 0, $_GET["proxy"],$pauth);
 68	is_page($page);
 69	$LINK = trim($loc);
 70  }
 71  is_present($page, "This file is no longer available");
 72  is_notpresent($page, "Download for free", "Download link not found");
 73  // Get first download link (download with free)
 74  preg_match('/<a class="download" href="(.*)">Download for free/',$page,$href);
 75  $Href = "http://".$Url['host'].$href[1];
 76  $Url = parse_url(trim($Href));
 77  $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, 0, 0, 0, $_GET["proxy"],$pauth);
 78  is_page($page);
 79  preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
 80	$cookie = $temp[1];
 81	$cook = implode(';',$cookie);
 82  // Find captcha image
 83  preg_match('/<img class="captchaImage" src="(.*)"/',$page,$capimg);
 84  if (!$capimg) html_error("Cannot find captcha image",0);
 85  $access_image_url = "http://".$Url['host'].$capimg[1];
 86  // Captcha ID
 87  preg_match('/<input id="captchaID" name="captchaID" type="hidden" value="(.*)"/',$page,$cID);
 88  $cID = $cID[1];
 89    
 90  print "<form name=\"dl\" action=\"".$PHP_SELF.(isset($_GET["audl"]) ? "?audl=doum" : "")."\" method=\"post\">\n";
 91  print "<input type=\"hidden\" name=\"link\" value=\"".urlencode($Href)."\">\n<input type=\"hidden\" name=\"link2\" value=\"".urlencode($LINK)."\">\n<input type=\"hidden\" name=\"referer\" value=\"".urlencode($Href)."\">\n<input type=\"hidden\" name=\"f\" value=\"$f\">\n<input type=\"hidden\" name=\"h\" value=\"$h\">\n<input type=\"hidden\" name=\"b\" value=\"$b\">\n<input type=\"hidden\" name=\"step\" value=\"1\">\n";
 92  print "<input type=\"hidden\" name=\"comment\" id=\"comment\" value=\"".$_GET["comment"]."\">\n<input type=\"hidden\" name=\"email\" id=\"email\" value=\"".$_GET["email"]."\">\n<input type=\"hidden\" name=\"partSize\" id=\"partSize\" value=\"".$_GET["partSize"]."\">\n<input type=\"hidden\" name=\"method\" id=\"method\" value=\"".$_GET["method"]."\">\n";
 93  print "<input type=\"hidden\" name=\"proxy\" id=\"proxy\" value=\"".$_GET["proxy"]."\">\n<input type=\"hidden\" name=\"proxyuser\" id=\"proxyuser\" value=\"".$_GET["proxyuser"]."\">\n<input type=\"hidden\" name=\"proxypass\" id=\"proxypass\" value=\"".$_GET["proxypass"]."\">\n<input type=\"hidden\" name=\"path\" id=\"path\" value=\"".$_GET["path"]."\">\n";
 94  print "<input type='hidden' name='cookie' value='$cook' /><input type='hidden' name='captchaID' value='$cID' />";
 95  print "<h4>Enter <img src=\"$access_image_url\"> here: <input type=\"text\" name=\"captcha\" size=\"4\">&nbsp;&nbsp;<input type=\"submit\" onclick=\"return check()\" value=\"Download File\"></h4>\n";
 96  print "<script language=\"JavaScript\">".$nn."function check() {".$nn."var imagecode=document.dl.captcha.value;".$nn.'if (imagecode == "") { window.alert("You didn\'t enter the image verification code"); return false; }'.$nn.'else { return true; }'.$nn.'}'.$nn.'</script>'.$nn;
 97  print "</form>\n</body>\n</html>";
 98  
 99  }
100}
101?>