Commit 6e757a7f authored by Jason R. Coombs's avatar Jason R. Coombs

Implemented download using wget

parent 87a0b219
......@@ -160,11 +160,11 @@ download_file_powershell.viable = (
)
def download_file_curl(url, target):
cmd = ['curl %(url)r -o %(target)s']
cmd = ['curl', url, '-o', target]
subprocess.check_call(cmd)
def has_curl():
cmd = ['curl --version']
cmd = ['curl', '--version']
try:
subprocess.check_call(cmd)
except:
......@@ -173,6 +173,20 @@ def has_curl():
download_file_curl.viable = has_curl
def download_file_wget(url, target):
cmd = ['wget', url, '-q', '-O', target]
subprocess.check_call(cmd)
def has_wget():
cmd = ['wget', '--version']
try:
subprocess.check_call(cmd)
except:
return False
return True
download_file_curl.viable = has_wget
def download_file_insecure(url, target):
"""
Use Python to download the file, even though it cannot authenticate the
......@@ -202,7 +216,7 @@ def get_best_downloader():
downloaders = [
download_file_powershell,
download_file_curl,
#download_file_wget,
download_file_wget,
download_file_insecure,
]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment