Change to Proxy Download #208
Reference in New Issue
Block a user
Delete Branch "pr1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Map button is using direct download, but this way the file name can be set which is VERY convenient. It's technically slower and more prone to failure, but maps are no bigger than ~20MB.
@@ -71,2 +71,4 @@return &info, nil}func (c *Client) DownloadAsset(info *AssetLocationInfo) ([]byte, error) {Instead of reading the entire stream into memory, return the reader (resp.Body) from this function to use in ogen.
This is the first thing I tried, but I expected that it would not work because I assumed that resp.Body.Close() had to be called after the body was read. I guess you don't actually need to call it then?
@@ -100,0 +99,4 @@// download the complete fileasset, err := svc.Roblox.DownloadAsset(info)ok.Data = bytes.NewReader(asset)You're basically reading all the data in DownloadAsset into a byte array, then turning around and throwing it back into a reader to do the whole process again. Have DownloadAsset return the reader from the request body and you get the following:
Great. I didn't know it would call close for me.
@@ -146,3 +132,1 @@} finally {setDownloading(false);}await delay(100); // Wait 100msWhat is this for
Trusting the client not to spam call the endpoint. I repurposed the function that was already there on a whim, it's not important
The files are empty with 0 bytes, that's what I was trying to fix by copying from the reader before as well
6dae7b7493toa05a20e5b3a05a20e5b3to592a48e100592a48e100to81bb72161481bb721614to5d04e1cb5b5d04e1cb5bto3e353b2ec6Apparently this works great.
I think I was using the wrong roblox api key during local testing, and forgot to add
so I never saw the api error 👍