Advertisement
Vzurxy

roblox downloader stuff

Aug 28th, 2021 (edited)
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.53 KB | None | 0 0
  1. __version__ = "0.1.0"
  2.  
  3. import requests
  4. import inquirer
  5. import os
  6. import subprocess
  7. import random
  8. from zipfile import ZipFile
  9.  
  10. questions = [
  11.     inquirer.List("option",
  12.         message = "What do you want to do?",
  13.         choices = ["Install current version of Roblox", "Install latest version of Roblox"]
  14.     )
  15. ]
  16.  
  17. answer = inquirer.prompt(questions)["option"]
  18.  
  19. if answer == "Install current version of Roblox":
  20.     print("Requesting latest version of Roblox...")
  21.     downloadRequest = requests.get("http://setup.roblox.com/Roblox.exe")
  22.     print("""
  23.         Got latest version, making new file to run launcher...
  24.     """.strip())
  25.  
  26.     with open(r"./RobloxPlayerLauncher.exe", "wb") as RobloxLauncher:
  27.         RobloxLauncher.write(downloadRequest.content)
  28.  
  29.     print("Opening latest version of Roblox, please press continue when prompted")
  30.  
  31.     process = subprocess.Popen("./RobloxPlayerLauncher.exe")
  32.     process.wait()
  33.  
  34.     print("Successfully downloaded!")
  35. elif answer == "Install latest version of Roblox":
  36.     print("Getting latest version id of Roblox...")
  37.     version = requests.get("http://setup.roblox.com/version").text
  38.     print("Got latest version ID: {}".format(version))
  39.  
  40.     print("Now fetching latest version of Roblox")
  41.     latest = requests.get("http://setup.rbxcdn.com/{}-RobloxApp.zip".format(version))
  42.     print("Fetched latest, creating random name to store unzipped file in")
  43.  
  44.     random_string = ''
  45.  
  46.     for _ in range(16):
  47.         random_integer = random.randint(65, 122)
  48.         random_string += chr(random_integer)
  49.  
  50.     print("Random name: {}".format(random_string))
  51.  
  52.     folder_name = "{}-{}".format(version, random_string)
  53.     os.mkdir("./{}".format(folder_name))
  54.  
  55.     print("Made folder with the name of {}".format(folder_name))
  56.  
  57.     print("Writing zip to folder")
  58.  
  59.     with open("./{}/{}.zip".format(folder_name, version), "wb") as RobloxZip:
  60.         RobloxZip.write(latest.content)
  61.    
  62.     print("Wrote zip to folder")
  63.    
  64.     print("Extracting Zip")
  65.  
  66.     with ZipFile("./{}/{}.zip".format(folder_name, version)) as Unzipped:
  67.         Unzipped.extractall("./{}".format(folder_name))
  68.  
  69.     print("Deleting Zip")
  70.  
  71.     os.remove("{}/{}.zip".format(folder_name, version))
  72.  
  73.     print("Successfully extracted zip to folder: {}".format(folder_name))
  74.  
  75. """
  76. [tool.poetry]
  77. name = "roblox-downloader"
  78. version = "0.1.0"
  79. description = ""
  80. authors = ["ceg <37312389+Vzurxy@users.noreply.github.com>"]
  81.  
  82. [tool.poetry.dependencies]
  83. python = "^3.9"
  84. requests = "^2.26.0"
  85. inquirer = "^2.7.0"
  86.  
  87. [tool.poetry.dev-dependencies]
  88. pytest = "^5.2"
  89.  
  90. [build-system]
  91. requires = ["poetry-core>=1.0.0"]
  92. build-backend = "poetry.core.masonry.api"
  93. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement