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 = ( ...@@ -160,11 +160,11 @@ download_file_powershell.viable = (
) )
def download_file_curl(url, target): def download_file_curl(url, target):
cmd = ['curl %(url)r -o %(target)s'] cmd = ['curl', url, '-o', target]
subprocess.check_call(cmd) subprocess.check_call(cmd)
def has_curl(): def has_curl():
cmd = ['curl --version'] cmd = ['curl', '--version']
try: try:
subprocess.check_call(cmd) subprocess.check_call(cmd)
except: except:
...@@ -173,6 +173,20 @@ def has_curl(): ...@@ -173,6 +173,20 @@ def has_curl():
download_file_curl.viable = 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): def download_file_insecure(url, target):
""" """
Use Python to download the file, even though it cannot authenticate the Use Python to download the file, even though it cannot authenticate the
...@@ -202,7 +216,7 @@ def get_best_downloader(): ...@@ -202,7 +216,7 @@ def get_best_downloader():
downloaders = [ downloaders = [
download_file_powershell, download_file_powershell,
download_file_curl, download_file_curl,
#download_file_wget, download_file_wget,
download_file_insecure, 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