def download_image(image_path, url, headers=None): # In case of v2 API, we need to append /file suffix to URL to download # image content. In case of v1 API, no URL changes are needed. if api_version(url) == "v2": url = url + "/file" with utils.stopwatch("Downloading {} to {}".format(url, image_path), level=logging.INFO, log=log): curlImgWrap.download(url, image_path, headers)
def httpDownloadImage(dstImgPath, methodArgs): curlImgWrap.download(methodArgs.get('url'), dstImgPath, methodArgs.get("headers", {}))