code: def download_to_file url, file
        url = URI.parse(URI.encode(url.strip))
  
        File.new(file, File::CREAT)
  
        Net::HTTP.start(url.host) { |http|
          resp = http.get(url.path)
          open(file, "wb") { |file|
            file.write(resp.body)
          }
        }
      end
docs: Download a url to a file path