From f8c71a4787e7da0140faa51d97cae0dc3756ad36 Mon Sep 17 00:00:00 2001 From: "Ali J. Ghandour" Date: Fri, 14 Oct 2022 09:02:15 +0300 Subject: [PATCH] Update build.py 1. fixing glew link 2. updating download_zipfile function from Colmap --- scripts/python/build.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/python/build.py b/scripts/python/build.py index 810dde2..609a7bd 100644 --- a/scripts/python/build.py +++ b/scripts/python/build.py @@ -39,7 +39,8 @@ import zipfile import hashlib import ssl -import urllib.request +#import urllib.request +import requests import subprocess import multiprocessing @@ -186,7 +187,10 @@ def check_md5_hash(path, md5_hash): def download_zipfile(url, archive_path, unzip_path, md5_hash): if not os.path.exists(archive_path): - urllib.request.urlretrieve(url, archive_path) + r = requests.get(url) + with open(archive_path, 'wb') as outfile: + outfile.write(r.content) + #urllib.request.urlretrieve(url, archive_path) # check_md5_hash(archive_path, md5_hash) with zipfile.ZipFile(archive_path, "r") as fid: fid.extractall(unzip_path) @@ -308,8 +312,7 @@ def build_glew(args): if os.path.exists(path): return - url = "https://kent.dl.sourceforge.net/project/glew/" \ - "glew/2.1.0/glew-2.1.0.zip" + url = "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.zip" archive_path = os.path.join(args.download_path, "glew-2.1.0.zip") download_zipfile(url, archive_path, args.build_path, "dff2939fd404d054c1036cc0409d19f1")