Need help on a python script with roblox upload api

  1. What do you want to achieve?
    I want to make it like a kind of auto-updater without needing to use Roblox studio to push a new update for my game
  2. What is the issue?
    when I use the python code it tells me in the output
<Response [500]>
  1. What solutions have you tried so far?
    tried changing files to data won’t work and I’m stuck with this error I also tried debugging it with prints

here is the code that I’m using right now for the python script

import requests

cookie = 'cookie'
xsrf = ''

url = 'http://data.roblox.com/Data/Upload.ashx?assetid=ID'
authurl = 'https://auth.roblox.com/v2/logout'

userAgent = 'Roblox/WinInet'

myfiles = {'Baseplate.rbxlx': open('Baseplate.rbxlx', 'rb')}

def getXsrf():
    xsrfRequest = requests.post(authurl, headers={
        'User-Agent': userAgent
    }, cookies={
        '.ROBLOSECURITY': cookie
    })
    if xsrfRequest.headers['x-csrf-token']:
        return xsrfRequest.headers['x-csrf-token']
    else:
        return ''


xsrf = getXsrf()
print(xsrf)
mainRequest = requests.post(url, headers={
    'Content-Type': 'application/xml',
    'User-Agent': userAgent,
    'x-csrf-token': xsrf
}, cookies={
    '.ROBLOSECURITY': cookie
}, files = myfiles)
print(mainRequest)
1 Like

instead maybe you can give the game an update using os.date instead of phython

No, I really want to use python for this

sorry then cant help you more bc i dont know phython sorry

I’m also encountering the same error whilst trying to publish the game through python. I’m guessing something is put in the xml before publishing such as the hardware adress.

Have you tried something like postman to send the same request?

500 = Internal Server error.