updated CURLOPTs to use CURLOPT_CONNECTTIMEOUT instead of CURLOPT_TIMEOUT, which was causing the download to be terminated after 5 seconds resulting in incomplete/corrupt files.