Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Roblox-Thot committed Mar 21, 2024
1 parent fa72b5b commit 483c387
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions DecalUploader/Uploader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rblxopencloud import User, AssetType, Asset, exceptions
import requests, random, string
from time import sleep as sleepy
from time import sleep
import xmltodict

class DecalClass:
Expand All @@ -24,7 +24,7 @@ def __get_api_key__(self) -> None:
}

response = requests.post("https://apis.roblox.com/cloud-authentication/v1/apiKey", json=payload, headers=headers, cookies={'.ROBLOSECURITY': self.cookie}).json()
#print(response)

self.api_key = response['apikeySecret']
self.keyId = response['cloudAuthInfo']['id']
self.creator = User(requests.get('https://www.roblox.com/mobileapi/userinfo',cookies={'.ROBLOSECURITY':self.cookie}).json()['UserID'],
Expand Down Expand Up @@ -52,17 +52,17 @@ def upload(self, file:bytes, title:str, description:str) -> Asset|None:
"""
asset = self.creator.upload_asset(file, self.asset_type, title, description)

sleepy(5)
sleep(5)

while True:
try:
if status:= asset.fetch_operation():
return status
except exceptions.PermissionDenied | exceptions.InvalidKey:
except exceptions.PermissionDenied | exceptions.InvalidKey: #TODO: if invalid key try and check for a ban/warn
return None
except Exception:
sleepy(0.5)
sleepy(0.2)
sleep(0.5)
sleep(0.2)

class Functions:
def get_image_id(decal_id:int|str) -> str:
Expand All @@ -79,7 +79,8 @@ def get_image_id(decal_id:int|str) -> str:
return result_url.split("=")[1]
except Exception as e:
print(e)
return "failed to get Imgid"
sleep(random.randint(0.1,1))
return Functions.get_image_id(decal_id)

if __name__ == '__main__':
input('you don\' run this file')

0 comments on commit 483c387

Please sign in to comment.