PageRenderTime 173ms CodeModel.GetById 141ms app.highlight 9ms RepoModel.GetById 21ms app.codeStats 0ms

/hosts/download/freakshare_net.php

https://github.com/gartz/RapidLeetch
PHP | 70 lines | 51 code | 18 blank | 1 comment | 14 complexity | e31731ee77345d8a45db9cd017f0e9f5 MD5 | raw file
 1<?php
 2if (!defined('RAPIDLEECH'))
 3  {
 4  require_once("index.html");
 5  exit;
 6  }
 7
 8$post = Array();
 9
10$FileName = !$FileName ? basename($Url["path"]) : $FileName;
11$FileName = str_replace(".html", "", $FileName);
12
13if (($_GET["premium_acc"] == "on" && $_GET["premium_user"] && $_GET["premium_pass"])) {
14	$Url =  parse_url("http://freakshare.net/login.html");
15	$post["user"] = $_GET["premium_user"];
16	$post["pass"] = $_GET["premium_pass"];
17	$post["submit"] = "Login";
18	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, $post, 0, $_GET["proxy"],$pauth);
19	is_page($page);
20
21	$cookie = GetCookies($page);
22	insert_timer(5, "Please wait while logging in");
23
24	$Url =  parse_url($LINK);
25	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, 0, 0, $_GET["proxy"],$pauth);
26	is_page($page);
27
28	if (stristr($page, "Location:")) {
29		$Href = trim(cut_str($page, "Location:","\n"));
30		$Url =  parse_url($Href);
31	} else {
32		html_error ("Cannot get download link!", 0 );
33	}
34
35} else {
36	$post["section"] = "waitingtime";
37	$post["did"] = "2";
38
39	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, 0, 0, 0, $_GET["proxy"],$pauth);
40	is_page($page);
41
42	$cookie = GetCookies($page);
43	$countdowntime = trim(cut_str($page, "var time = ",";"));
44
45	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, $post, 0, $_GET["proxy"],$pauth);
46	is_page($page);
47
48	if (!stristr($page, "Location:")) {
49		insert_timer(3, "");
50		$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, $post, 0, $_GET["proxy"],$pauth);
51	}
52
53	if (stristr($page, "Location:")) {
54		$Href = trim(cut_str($page, "Location:","\n"));
55		$Url =  parse_url($Href);
56	} else {
57		html_error ("Cannot get download link!", 0 );
58	}
59
60	$cookie .= "; " . GetCookies($page);
61
62	insert_timer($countdowntime, "Please wait while getting file.");
63}
64
65insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&port=".$Url["port"]."&path=".urlencode($Url["path"].($Url["query"] ? "?".$Url["query"] : ""))."&referer=".urlencode($LINK)."&email=".($_GET["domail"] ? $_GET["email"] : "")."&partSize=".($_GET["split"] ? $_GET["partSize"] : "")."&method=".$_GET["method"]."&proxy=".($_GET["useproxy"] ? $_GET["proxy"] : "")."&saveto=".$_GET["path"]."&link=".urlencode($LINK).($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "")."&auth=".$auth.($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
66
67
68// by plapla on Nov 25, 2009
69
70?>