Reverse engineered prompt

Build me a tiny command line app called tordl that downloads a file from a URL through the Tor network. I want it to work with onion links, but regular web links should work too, they should just be routed through the Tor proxy as well. The main experience should be very simple, I give it a URL and it downloads the file locally.

Please include a timeout option with both a short flag and a long flag, where the value is in seconds. Make the default timeout 120 seconds, and let 0 mean no timeout at all. A couple of basic examples would be great, one using an onion URL and one using a normal URL. I also want a short README that explains how to run it, what the timeout setting does, and that all requests are going through Tor. If you need to, look up current docs online for the best way to send HTTP requests through a Tor proxy.

Want more depth? Deep Reverse