Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __version__ = "0.1.0"
- import requests
- import inquirer
- import os
- import subprocess
- import random
- from zipfile import ZipFile
- questions = [
- inquirer.List("option",
- message = "What do you want to do?",
- choices = ["Install current version of Roblox", "Install latest version of Roblox"]
- )
- ]
- answer = inquirer.prompt(questions)["option"]
- if answer == "Install current version of Roblox":
- print("Requesting latest version of Roblox...")
- downloadRequest = requests.get("http://setup.roblox.com/Roblox.exe")
- print("""
- Got latest version, making new file to run launcher...
- """.strip())
- with open(r"./RobloxPlayerLauncher.exe", "wb") as RobloxLauncher:
- RobloxLauncher.write(downloadRequest.content)
- print("Opening latest version of Roblox, please press continue when prompted")
- process = subprocess.Popen("./RobloxPlayerLauncher.exe")
- process.wait()
- print("Successfully downloaded!")
- elif answer == "Install latest version of Roblox":
- print("Getting latest version id of Roblox...")
- version = requests.get("http://setup.roblox.com/version").text
- print("Got latest version ID: {}".format(version))
- print("Now fetching latest version of Roblox")
- latest = requests.get("http://setup.rbxcdn.com/{}-RobloxApp.zip".format(version))
- print("Fetched latest, creating random name to store unzipped file in")
- random_string = ''
- for _ in range(16):
- random_integer = random.randint(65, 122)
- random_string += chr(random_integer)
- print("Random name: {}".format(random_string))
- folder_name = "{}-{}".format(version, random_string)
- os.mkdir("./{}".format(folder_name))
- print("Made folder with the name of {}".format(folder_name))
- print("Writing zip to folder")
- with open("./{}/{}.zip".format(folder_name, version), "wb") as RobloxZip:
- RobloxZip.write(latest.content)
- print("Wrote zip to folder")
- print("Extracting Zip")
- with ZipFile("./{}/{}.zip".format(folder_name, version)) as Unzipped:
- Unzipped.extractall("./{}".format(folder_name))
- print("Deleting Zip")
- os.remove("{}/{}.zip".format(folder_name, version))
- print("Successfully extracted zip to folder: {}".format(folder_name))
- """
- [tool.poetry]
- name = "roblox-downloader"
- version = "0.1.0"
- description = ""
- authors = ["ceg <37312389+Vzurxy@users.noreply.github.com>"]
- [tool.poetry.dependencies]
- python = "^3.9"
- requests = "^2.26.0"
- inquirer = "^2.7.0"
- [tool.poetry.dev-dependencies]
- pytest = "^5.2"
- [build-system]
- requires = ["poetry-core>=1.0.0"]
- build-backend = "poetry.core.masonry.api"
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement