aboutsummaryrefslogtreecommitdiff
path: root/update.py
diff options
context:
space:
mode:
Diffstat (limited to 'update.py')
-rwxr-xr-xupdate.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/update.py b/update.py
index 11c6b4c..4e4dad1 100755
--- a/update.py
+++ b/update.py
@@ -1,8 +1,8 @@
#!/bin/python3
-from urllib.request import urlretrieve
+from requests import get
from os import listdir, remove
-from shutil import rmtree
+from shutil import rmtree, copyfileobj
INSTALL_DIR = ""
with open("pack-location.txt", "r") as f:
@@ -27,7 +27,9 @@ for mod in DOWNLOADS:
print("Skipping " + mod[0] + ", already up-to-date")
else:
print("Installing " + mod[0] + " from " + mod[1] + "...")
- urlretrieve(mod[1], INSTALL_DIR + "/" + mod[0])
+ download_obj = get(mod[1], stream=True)
+ with open(INSTALL_DIR + "/" + mod[0], "wb") as write_file:
+ copyfileobj(download_obj.raw, write_file)
print("Done!")
print("\nRemoving old versions...")