Fixed download path issue resulting in failed build. Added download progress print.

This commit is contained in:
httim committed 2023-05-31 15:44:18 +02:00
1 parent 2aac2d136c
commit cb1ab593b2
1 file changed
+7 -4
+7 -4
View File
@@ -77,12 +77,15 @@ def download_using_id(download_id: str, refer_id: str = "77ef91f67a9e411bbbe299e
download_url = download_url_response.content.decode('utf-8') download_url = download_url_response.content.decode('utf-8')
download_response = requests.get(download_url, stream=True)
download_reponse = requests.get(download_url, stream=True) total_size_in_bytes = int(download_response.headers.get('Content-Length', 0))
progress = 0
with open("./resolve.zip", "wb") as f: with open("./resolve.zip", "wb") as f:
for chunk in download_reponse.iter_content(chunk_size=32*1024): for chunk in download_response.iter_content(chunk_size=32 * 1024):
f.write(chunk) f.write(chunk)
progress += len(chunk)
print(" " + str(round(progress / total_size_in_bytes * 100, 4)) + "%")
print("Extracting resolve installation...") print("Extracting resolve installation...")
with zipfile.ZipFile("./resolve.zip", 'r') as zip_file: with zipfile.ZipFile("./resolve.zip", 'r') as zip_file:
zip_file.extractall('resolve') zip_file.extractall('.')