From 46b47199faa816bbb7a4bdaae701c67564185cb1 Mon Sep 17 00:00:00 2001 From: Alexander Hayden Date: Sat, 12 Jan 2019 21:06:10 -0500 Subject: Make redirects work (fix the bork) --- update.py | 8 +++++--- 1 file 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...") -- cgit v1.2.3