ecco7777

CC wget 1.7

Nov 25th, 2025
617
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.28 KB | None | 0 0
  1. args={...}
  2. url = args[1]
  3. filename = args[2]
  4.  
  5. h = http.get(url)
  6. if h then
  7.     local content = h.readAll()
  8.     h.close()
  9.     local f = fs.open(filename, "w")
  10.     f.write(content)
  11.     f.close()
  12.     print("Downloaded "..filename)
  13. else
  14.     print("HTTP request failed")
  15. end
  16.  
Advertisement
Add Comment
Please, Sign In to add comment