Synapse
PogChamp
- Mar 3, 2012
- 164
- 59
Hello,
After seeing many hotels struggling to update their clothing themselves, I decided to create a tool which grabs all of the latest clothing from Habbo. But, I decided I shouldn't stop there. With this tool you will be able to import your current figuremap to allow the tool to only download the ones you don't have! But wait it gets better, you know those annoying XML snippets you have to add one by one? Well, this tool will generate the XML needed for the clothing you downloaded!
The current alpha/proof of concept version can be seen at
Habbo Asset Updater
Features:
Might be added:
See it in action:
Code snippets:
After seeing many hotels struggling to update their clothing themselves, I decided to create a tool which grabs all of the latest clothing from Habbo. But, I decided I shouldn't stop there. With this tool you will be able to import your current figuremap to allow the tool to only download the ones you don't have! But wait it gets better, you know those annoying XML snippets you have to add one by one? Well, this tool will generate the XML needed for the clothing you downloaded!
The current alpha/proof of concept version can be seen at
You must be registered for see links
, however this is still considered to be a prereleased version. And is very poorly implemented.Habbo Asset Updater
Features:
- Download all of Habbo's latest clothing
- Generate XML for only the clothing you need
- Choose your export path
Might be added:
- Download badges, and generate the respective text
- Download furniture and generate SQL queries for them
- Download latest hotelview imagary
- Maybe more?
See it in action:
Excerpt from main.py
Excerpt from Req.py (still a bit rough)
Code:
def getExternal(id):
global lines
# Check if external variables is cached if not, make a request
try:
lines
except:
externalVars = makeRequest("https://www.habbo.com/gamedata/external_variables/0")
lines = externalVars.splitlines()
for line in lines:
if line.startswith(id.encode()):
line = line.decode("utf-8")
line = line.replace(id+"=", "")
if line.startswith("${url.prefix}"):
line = line.replace("${url.prefix}", "https://habbo.com")
if not line.startswith("http"):
line = "https:"+line
return line
def clothingList():
global production
clothingItems = []
figureData = makeRequest(production+"figuremap.xml")
figureData = BeautifulSoup(figureData, "html.parser")
for lib in figureData.find_all("lib", id=True):
clothingItems.append(production+lib['id']+".swf")
return clothingItems
production = getExternal("flash.client.url")
def worker():
while True:
item = q.get()
print(Req.download(item))
q.task_done()
q = Queue()
for i in range(14):
t = Thread(target=worker)
t.daemon = True
t.start()
def run():
clothes = clothingList()
for cloth in clothes:
q.put(cloth)
del clothes
Code:
def download(url, extention=False):
if Req.validUrl(url):
filename = url.split('/')[-1]
if extention == False:
if "." in filename:
extention = filename.split('.')[1]
else:
return ["error", "ERROR(004): No extention specified."]
else:
filename = filename+"."+extention
if not Req.fileExists(filename):
extentions = ["swf", "png", "gif"]
if extention in extentions:
r = scraper.get(url, stream=True, headers=headers)
with open(filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
return filename
else:
return ["error", "ERROR(003): '{}' is an invalid, or unsupported extention. ({})".format(extention, url)]
else:
return ["error", "{}, seems to already exist.".format(filename)]
else:
return ["error", "ERROR(001): '{}' appears to be an invalid url. ".format(url)]
Last edited: