I wrote this automation script, because of the absurd situation I was in (I needed to grant ~50 audio permissions and there was no way I was doing that manually).
Small How-To
This tutorial may demand some computer & python knowledge. If there will be the need, i might make a more in-depth and a user-friendly guide for this.
You might need to play with the time.sleep()
times a little bit so that it works smoothly for you, but the setup is pretty simple:
You need:
- One or more universe id’s.
- One or more sound id’s. (if you need a convenient way to get them, look at the bottom of this post )
- Your Roblox cookie. (
.ROBLOSECURITY
). - Python 3
-
undetected-chromedriver
andselenium
Python modules installed.
Once you get these, just put them into the script. Here’s an example how that might look:
And you should be ready to run the script!
The script in question:
import undetected_chromedriver as uc
from selenium.webdriver.common.by import By
import time
universeIds = []
soundIds = []
roblosecurity = ""
if __name__ == '__main__':
driver = uc.Chrome(headless=False,use_subprocess=False)
driver.get('https://create.roblox.com/')
driver.add_cookie({
"name": ".ROBLOSECURITY",
"value": roblosecurity,
"domain": ".roblox.com",
})
time.sleep(2)
driver.get("https://create.roblox.com/dashboard/creations")
for sId in soundIds:
print("Sound id:", sId)
driver.get(f"https://create.roblox.com/dashboard/creations/marketplace/{sId}/permissions")
time.sleep(2)
input_element = driver.find_element(By.ID, "privateExperienceAccessId")
button_element = driver.find_element(By.XPATH, '//button[text()="Add"]')
for uId in universeIds:
input_element.clear()
input_element.send_keys(uId)
time.sleep(1)
if input_element.is_enabled():
button_element.click()
else:
print("Waiting for #privateExperienceAccessId button. (Maybe increase the wait?)")
time.sleep(5)
if input_element.is_enabled():
button_element.click()
time.sleep(3)
else:
time.sleep(1)
continue
button_element = driver.find_element(By.XPATH, '//button[text()="Save changes"]')
if not button_element.is_enabled():
print("Button grayed out, waiting")
time.sleep(5)
if button_element.is_enabled():
button_element.click()
time.sleep(3)
print("done")
time.sleep(10)
A more convenient way of getting sound id’s
I’ve made a small Plugin, for getting all sound id’s of sounds (which are owned by the user) under a selected instance.
How does one use it? Select an instance in the explorer and use the Get Sound Id's
button. This will print out all of the id’s found in the console.
-- by KernelDeveloper (https://github.com/370rokas/)
local selection = game:GetService("Selection")
local marketplace = game:GetService("MarketplaceService")
local studio = game:GetService("StudioService")
local https = game:GetService("HttpService")
local userId = studio:GetUserId()
function RemoveTableDupes(tab)
local a = {}
local res = {}
for _,v in ipairs(tab) do
if (not a[v]) then
res[#res+1] = v
a[v] = true
end
end
return res
end
local toolbar = plugin:CreateToolbar("IDGatherer")
local meshIdBtn = toolbar:CreateButton("Get Mesh Id's", "Get all mesh id's from the selected model", "rbxassetid://4458901886")
meshIdBtn.ClickableWhenViewportHidden = false
local soundIdBtn = toolbar:CreateButton("Get Sound Id's", "Get all sound id's from the selected model", "rbxassetid://4458901886")
soundIdBtn.ClickableWhenViewportHidden = false
meshIdBtn.Click:Connect(function()
local selectedObjects = selection:Get()
if #selectedObjects > 0 then
local MeshIds = {}
for _,v in ipairs(selectedObjects) do
local d = v:GetDescendants()
for _,v0 in ipairs(d) do
if v0:IsA("MeshPart") then
local raw = v0.MeshId
local assetId = string.match(raw, "%d+")
if assetId ~= nil then
local asset = marketplace:GetProductInfo(assetId)
if asset.Creator.CreatorTargetId == userId then
table.insert(MeshIds, asset.AssetId)
end
end
end
end
end
print("Done: ")
print(https:JSONEncode(RemoveTableDupes(MeshIds)))
else
print("No selected models.")
end
end)
soundIdBtn.Click:Connect(function()
local userId = studio:GetUserId()
local selectedObjects = selection:Get()
if #selectedObjects > 0 then
local MeshIds = {}
for _,v in ipairs(selectedObjects) do
local d = v:GetDescendants()
for _,v0 in ipairs(d) do
if v0:IsA("Sound") then
local raw = v0.SoundId
local assetId = string.match(raw, "%d+")
if assetId ~= nil then
local asset = marketplace:GetProductInfo(assetId)
if asset.Creator.CreatorTargetId == userId then
table.insert(MeshIds, asset.AssetId)
end
end
end
end
end
print("Done: ")
print(https:JSONEncode(RemoveTableDupes(MeshIds)))
else
print("No selected models.")
end
end)
Help, Bugs?
Feel free to report any bugs/errors or questions you may have in this thread. I will try, but I can’t promise that I will answer all of them
In the future, I may clean the code up, set up a GitHub repo, etc, but idk… Anyways, enjoy !