From 8142c4d553d80aa24f398f6710bc2b5c3d9c9308 Mon Sep 17 00:00:00 2001 From: Jonas Schubert Erlandsson Date: Sun, 3 May 2015 23:46:09 +0200 Subject: [PATCH] Solves issue 48 - CA certificate set... Since Curl doesn't like it when both `--insecure` and a valid `--cacert` is present we make them mutually exclusive. --- src/udemy_dl/download.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/udemy_dl/download.py b/src/udemy_dl/download.py index 5d06877..b687af0 100644 --- a/src/udemy_dl/download.py +++ b/src/udemy_dl/download.py @@ -21,11 +21,13 @@ def download(link, filename): def curl_dl(link, filename): - command = ['curl', '-C', '-', link, '-o', filename,'--insecure'] + command = ['curl', '-C', '-', link, '-o', filename] cert_path = requests.certs.where() if cert_path: command.extend(['--cacert', cert_path]) + else: + command.extend(['--insecure']) subprocess.call(command)