mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 10:36:44 +00:00
Fix wget using obsolete file and HTTP Lua methods
Signed-off-by: Alessandro Proto <alex@alexdevs.me>
This commit is contained in:
parent
c19fb78b1f
commit
2445175248
1 changed files with 5 additions and 3 deletions
|
@ -19,6 +19,8 @@ if not http.checkURL(args[1]) then
|
||||||
error("Invalid URL", 0)
|
error("Invalid URL", 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
print("Connecting...")
|
||||||
|
|
||||||
local response, err = http.get(args[1], nil, {
|
local response, err = http.get(args[1], nil, {
|
||||||
binary = true,
|
binary = true,
|
||||||
})
|
})
|
||||||
|
@ -27,8 +29,8 @@ if not response then
|
||||||
end
|
end
|
||||||
|
|
||||||
local file <close> = fs.open(outputPath, "wb")
|
local file <close> = fs.open(outputPath, "wb")
|
||||||
file:write(response:readAll())
|
file:write(response.content:read("a"))
|
||||||
file:close()
|
file:close()
|
||||||
response:close()
|
response.content:close()
|
||||||
|
|
||||||
print("File written to " .. outputPath)
|
print("Downloaded to " .. outputPath)
|
||||||
|
|
Loading…
Reference in a new issue