I had given up messing with chatgpt and got a script from github doing the same thing, but I'm having the same issue of file downloading but being broken. So I'm guessing it's not a chat gpt issue, will try to fix the code