Advertisement
Flameso_o16

roblox asset downloader

May 4th, 2025
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.01 KB | None | 0 0
  1. # if the imports are underline yellow you have to install them pip install ....
  2. # you also need to own the plugin
  3.  
  4. import tkinter as tk
  5. from tkinter import messagebox, filedialog
  6. import requests
  7.  
  8. def download_rbxl():
  9.     asset_id = entry_asset_id.get().strip()
  10.     roblox_cookie = entry_cookie.get().strip()
  11.  
  12.     if not asset_id.isdigit():
  13.         messagebox.showerror("Invalid ID", "Asset ID must be a number.")
  14.         return
  15.  
  16.     if not roblox_cookie:
  17.         messagebox.showerror("Missing Cookie", "Please enter your .ROBLOSECURITY cookie.")
  18.         return
  19.  
  20.     headers = {
  21.         "Cookie": f".ROBLOSECURITY={roblox_cookie}",
  22.         "User-Agent": "Roblox/WinInet",
  23.     }
  24.  
  25.     try:
  26.         url = f"https://assetdelivery.roblox.com/v1/asset/?id={asset_id}"
  27.         response = requests.get(url, headers=headers)
  28.  
  29.         if response.status_code != 200:
  30.             messagebox.showerror("Download Failed", f"Error {response.status_code}:\n{response.text}")
  31.             return
  32.  
  33.         save_path = filedialog.asksaveasfilename(defaultextension=".rbxl",
  34.                                                  filetypes=[("Roblox Files", "*.rbxl"), ("All Files", "*.*")],
  35.                                                  initialfile=f"{asset_id}.rbxl")
  36.  
  37.         if not save_path:
  38.             return
  39.  
  40.         with open(save_path, 'wb') as f:
  41.             f.write(response.content)
  42.  
  43.         messagebox.showinfo("Success", f"Downloaded asset {asset_id} as .rbxl!")
  44.  
  45.     except Exception as e:
  46.         messagebox.showerror("Error", f"Something went wrong:\n{str(e)}")
  47.  
  48. root = tk.Tk()
  49. root.title("Roblox Asset Downloader")
  50.  
  51. tk.Label(root, text="Roblox Asset ID:").pack(pady=(10, 0))
  52. entry_asset_id = tk.Entry(root, width=50)
  53. entry_asset_id.pack(pady=5)
  54.  
  55. tk.Label(root, text=".ROBLOSECURITY Cookie:").pack(pady=(10, 0))
  56. entry_cookie = tk.Entry(root, width=50, show="*")
  57. entry_cookie.pack(pady=5)
  58.  
  59. tk.Button(root, text="Download .rbxl", command=download_rbxl).pack(pady=20)
  60.  
  61. root.geometry("400x250")
  62. root.mainloop()
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement