PageRenderTime 25ms CodeModel.GetById 15ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/hosts/depositfiles_com.php

https://github.com/gartz/RapidLeetch
PHP | 51 lines | 42 code | 7 blank | 2 comment | 12 complexity | baf1fdf7932b9ab459406cd69209f8f7 MD5 | raw file
 1<?php
 2if (!defined('RAPIDLEECH'))
 3{
 4	require_once("index.html");
 5	exit;
 6}
 7
 8if (preg_match('%^/ru/files/%', $Url["path"]) != 0)
 9{
10	$Url["path"] = preg_replace('%^/ru/files/%', '/en/files/', $Url["path"]);
11} elseif (preg_match('%^/de/files/%', $Url["path"]) != 0) {
12	$Url["path"] = preg_replace('%^/de/files/%', '/en/files/', $Url["path"]);
13} elseif (preg_match('%^/es/files/%', $Url["path"]) != 0) {
14	$Url["path"] = preg_replace('%^/es/files/%', '/en/files/', $Url["path"]);
15} elseif (preg_match('%^/files/%', $Url["path"]) != 0) {
16	$Url["path"] = preg_replace('%^/files/%', '/en/files/', $Url["path"]);
17}
18$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
19//file_put_contents("depositfiles_1.txt", $page);
20is_page($page);
21is_present($page, "Such file does not exist or it has been removed for infringement of copyrights.");
22is_present($page, "Your IP is already downloading a file from our system.");
23
24if (stristr($page,'You used up your limit for file downloading!')) {
25	preg_match('/([0-9]+) minute\(s\)/',$page,$minutes);
26	html_error("Download limit exceeded. Try again in ".trim($minutes[1])." minute(s)", 0);
27}
28
29if (preg_match('/<input type="submit" class="button" value="FREE downloading"/', $page))
30{
31	$post = Array();
32	$post["gateway_result"] = 1;
33	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, 0, $post, 0, $_GET["proxy"],$pauth);
34	//file_put_contents("depositfiles_2.txt", $page);
35	is_page($page);
36}
37
38preg_match('/<span id="download_waiter_remain">(.*)<\/span>/',$page,$countDown);
39$countDown = (int) $countDown[1];
40
41insert_timer($countDown, "The file is being prepared.","",true);
42
43if (preg_match('/<form action="(.*)" method="get" onSubmit="download_started()/U',$page,$dlink)) {
44	$Url = parse_url(trim($dlink[1]));
45	$FileName = basename($Url["path"]);
46} else {
47	html_error("Error getting download link", 0);
48}
49
50insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&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"]) : "").($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
51?>