Skip to content

Commit

Permalink
rere pepe
Browse files Browse the repository at this point in the history
  • Loading branch information
Roblox-Thot committed Mar 12, 2024
1 parent 315f662 commit 3a48568
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
31 changes: 14 additions & 17 deletions DecalUploader/Uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def upload(self, file:bytes, title:str, description:str):
sleepy(0.2)

class Functions:
def send_discord_message(webhook,name_value,decal_value,img_value):
def send_discord_message(webhook:str, name_value:str, decal_value, img_value):
# sourcery skip: instance-method-first-arg-name
decal_value = int(decal_value)
img_value = int(img_value)
Expand All @@ -89,23 +89,20 @@ def send_discord_message(webhook,name_value,decal_value,img_value):
WEBHOOK = '' # Webhook doesn't exist so don't keep sending stuff

def get_image_id(decal_id):
# sourcery skip: inline-immediately-returned-variable, instance-method-first-arg-name, last-if-guard, remove-unnecessary-else, swap-if-else-branches
if decal_id:
url = f"https://assetdelivery.roblox.com/v1/asset/?id={decal_id}"
try:
response = requests.get(url)
if response.status_code == 200:
xml_data = xmltodict.parse(response.text)
result_url = xml_data['roblox']['Item']['Properties']['Content']['url']
result = result_url.split("=")[1]
return result
else:
return "failed to get Imgid"
except Exception as e:
print(e)
return "failed to get Imgid"
else:
# sourcery skip: instance-method-first-arg-name
if not decal_id:
return "no decal id passed???"
url = f"https://assetdelivery.roblox.com/v1/asset/?id={decal_id}"
try:
response = requests.get(url)
if response.status_code != 200:
return "failed to get Imgid"
xml_data = xmltodict.parse(response.text)
result_url = xml_data['roblox']['Item']['Properties']['Content']['url']
return result_url.split("=")[1]
except Exception as e:
print(e)
return "failed to get Imgid"

if __name__ == '__main__':
input('you don\' run this file')
6 changes: 4 additions & 2 deletions FolderUploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
DESCRIPTION:str = CONFIG['description']

class ThreadShit:
def upload(self, creator:DecalClass, filename:str, barrier:threading.Barrier):
def upload(creator:DecalClass, filename:str, barrier:threading.Barrier):
# sourcery skip: instance-method-first-arg-name
with open(f'decals/{filename}', "rb") as file:
barrier.wait()
while True: # keep uploading till one works :)
Expand All @@ -34,7 +35,8 @@ def upload(self, creator:DecalClass, filename:str, barrier:threading.Barrier):
a.write(f'{clean_filename},{asset.id},{img_id}\n')
Checker(asset.id, img_id, WEBHOOK)

def start(self, files: list, ROBLOSECURITY:str):
def start(files: list, ROBLOSECURITY:str):
# sourcery skip: instance-method-first-arg-name
creator = DecalClass(ROBLOSECURITY)
barrier = threading.Barrier(len(files)+1)
threads = []
Expand Down

0 comments on commit 3a48568

Please sign in to comment.