Files
Archive/Habbo Vault/tools/FurnitureDownloader/PHBHabboFurnitureDownloader-2.0/index.php

136 lines
6.4 KiB
PHP
Executable File

<!DOCTYPE html>
<html>
<head>
<title>Downloader de mobis - by PHB</title>
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<link rel="icon" href="https://galaxyservers.com.br/assets/galaxy/favicon.png">
</head>
<body>
<br><br><br>
<center><img src="https://i.imgur.com/OgzOTsI.png"></center>
<br><br>
<center>
<form method="post" style="width:50%">
<?php
set_time_limit(0);
error_reporting(E_ALL);
$arrRequestHeaders = array(
'http' => array(
'method' => 'GET',
'protocol_version' => 1.1,
'follow_location' => 1,
'header' => "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
)
);
if (isset($_POST['pega'])) {
$xml = $_POST['xml'];
$pasta = $_POST['pasta'];
$pagina = $_POST['pagina'];
$path_sql = "downloads/" . $pasta . "/sql.sql";
$path_xml = "downloads/" . $pasta . "/xml.txt";
$path_xml_original = "downloads/" . $pasta . "/xml_original.txt";
$path_pasta = "downloads/" . $pasta . "/mobis/";
if($_POST['icone'] == "separar") $path_icones = "downloads/" . $pasta . "/icones/"; else $path_icones = "downloads/" . $pasta . "/mobis/";
$i = 0;
$xml_escreve = "";
$sql_escreve = "";
$id_pag = rand(100, 40000);
$furnidata = simplexml_load_string("<phb>" . $xml . "</phb>");
$sql_escreve .= "INSERT INTO `catalog_pages` (`id`, `parent_id`, `caption`) VALUES ('" . $id_pag . "', '1425622122', '" . $pagina . "');" . "\n";
@mkdir("downloads/");
@mkdir("downloads/" . $pasta);
@mkdir("downloads/" . $pasta . "/mobis/");
if($_POST['icone'] == "separar") @mkdir("downloads/" . $pasta . "/icones/");
foreach ($furnidata->furnitype as $mobi) {
$i++;
if ($_POST['id'] == "random")
$rand = rand(111, 444);
else
$rand = "";
/// Gera arquivo XML
$xml_escreve .= '<furnitype id="' . $rand . $mobi['id'] . '" classname="' . $mobi['classname'] . '">' . "\n";
$xml_escreve .= '<partcolors>';
foreach ($mobi->partcolors->color as $cor) {
$xml_escreve .= "<color>" . $cor . "</color>";
}
$xml_escreve .= '</partcolors>' . "\n";
$xml_escreve .= '<name>' . $mobi->name . '</name>' . "\n";
$xml_escreve .= '<description>' . $mobi->description . '</description>' . "\n";
$xml_escreve .= '<adurl/>' . "\n";
$xml_escreve .= '<offerid>' . $rand . $mobi['id'] . '</offerid><rentofferid>-1</rentofferid><rentbuyout>0</rentbuyout>' . "\n";
$xml_escreve .= '</furnitype>' . "\n";
/// Gera SQL
$sql_escreve .= "INSERT INTO `catalog_items` (`item_ids`, `page_id`, `catalog_name`, `offer_id`) VALUES ('" . $rand . $mobi['id'] . "', '" . $id_pag . "', '" . $mobi['classname'] . "', '" . $rand . $mobi['id'] . "');";
$sql_escreve .= "\n";
$sql_escreve .= "INSERT INTO `items_base` (`id`, `sprite_id`, `public_name`, `item_name`, `width`, `length`, `stack_height`, `allow_sit`, `interaction_type`) VALUES ('" . $rand . $mobi['id'] . "', '" . $rand . $mobi['id'] . "', '" . $mobi->name . "', '" . $mobi['classname'] . "', '" . $mobi->xdim . "', '" . $mobi->ydim . "', '0','" . $mobi->cansiton . "', 'default');" . "\n";
/// Download do mobi
if (mb_strpos($mobi['classname'], '*') !== false) {
$icone = str_replace("*", "_", $mobi['classname']);
$mobi['classname'] = explode("*", $mobi['classname'])[0];
} else {
$icone = $mobi['classname'];
}
if ($_POST['hotel'] == "habbocity") {
copy("https://swf.habbocity.me/dcr/hof_furni/" . $mobi['classname'] . ".swf", $path_pasta . $mobi['classname'] . ".swf", stream_context_create($arrRequestHeaders));
copy("https://images.habbogroup.com/dcr/hof_furni/" . $mobi->revision . "/" . $icone . "_icon.png", $path_icones . $icone . "_icon.png");
} else if ($_POST['hotel'] == "space") {
copy("https://images.spacehotel.co/hof_furni/" . $mobi['classname'] . ".swf", $path_pasta . $mobi['classname'] . ".swf", stream_context_create($arrRequestHeaders));
copy("https://images.spacehotel.co/hof_furni/icon/view.php?name=" . $mobi['classname'] . "_icon.png", $path_icones . $mobi['classname'] . "_icon.png", stream_context_create($arrRequestHeaders));
} else if ($_POST['hotel'] == "iron") {
copy("https://cdn.ironhotel.biz/static_global/furniture/" . $mobi['classname'] . ".swf", $path_pasta . $mobi['classname'] . ".swf", stream_context_create($arrRequestHeaders));
copy("https://cdn.ironhotel.biz/static_global/furniture/icons/" . $mobi['classname'] . "_icon.png", $path_icones . $mobi['classname'] . "_icon.png", stream_context_create($arrRequestHeaders));
} else {
copy("https://images.habbogroup.com/dcr/hof_furni/" . $mobi->revision . "/" . $mobi['classname'] . ".swf", $path_pasta . $mobi['classname'] . ".swf");
copy("https://images.habbogroup.com/dcr/hof_furni/" . $mobi->revision . "/" . $icone . "_icon.png", $path_icones . $icone . "_icon.png");
}
}
fwrite(fopen($path_sql, "w"), $sql_escreve);
fwrite(fopen($path_xml, "w"), $xml_escreve);
fwrite(fopen($path_xml_original, "w"), $xml);
echo '<div class="alert alert-success" role="alert">
<strong>Sucesso!</strong> Foram baixados '.$i.' mobis.
</div>';
}
?>
<input type="text" class="form-control" placeholder="Nome pasta - Download folder name" name="pasta" required><br>
<input type="text" class="form-control" placeholder="Nome página catálogo - Catalog page name" name="pagina" required><br>
<select class="form-control" name="hotel">
<option value="habbo">Download do Habbo Original - habbo.com</option>
<option value="habbocity">Download do Habbocity - habbocity.me</option>
<option value="space">Download do Space Hotel - spacehotel.co</option>
<option value="iron">Download do Iron Hotel - ironhotel.biz</option>
</select><br>
<select class="form-control" name="id">
<option value="random">Gerar ID aleatório - Get Random ID</option>
<option value="xml">Usar ID da XML - Get XML ID</option>
</select><br>
<select class="form-control" name="icone">
<option value="nao">Não separar ícones em uma nova pasta</option>
<option value="separar">Separar ícones em uma pasta</option>
</select><br>
<textarea name="xml" class="form-control" placeholder="XML furnitype tag's"></textarea><br><br>
<button type="submit" class="btn btn-primary" name="pega">Download</button>
</form>
</center>
</body>
</html>