diff options
-rwxr-xr-x | update.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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...") |