diff --git a/Scripts/downloader.py b/Scripts/downloader.py index 2399451..f30f6bd 100755 --- a/Scripts/downloader.py +++ b/Scripts/downloader.py @@ -1,4 +1,5 @@ -import sys, os, time, ssl +import sys, os, time, ssl, gzip +from io import BytesIO # Python-aware urllib stuff if sys.version_info >= (3, 0): from urllib.request import urlopen, Request @@ -130,6 +131,10 @@ class Downloader: if not chunk: break chunk_so_far += chunk + if response.headers.get('Content-Encoding') == "gzip": + fileobj = BytesIO(chunk_so_far) + file = gzip.GzipFile(fileobj=fileobj) + return file.read() return chunk_so_far def stream_to_file(self, url, file, progress = True, headers = None): diff --git a/gibMacOS.command b/gibMacOS.command index d08b5ce..d5a86ba 100755 --- a/gibMacOS.command +++ b/gibMacOS.command @@ -212,6 +212,10 @@ class gibMacOS: else: # Add them all! prodd["packages"] = plist_dict.get("Products",{}).get(prod,{}).get("Packages",[]) + # Get size + prodd["size"] = 0 + for i in prodd["packages"]: prodd["size"] += i["Size"] + prodd["size"] = self.d.get_size(prodd["size"]) # Attempt to get the build/version info from the dist b,v,n = self.get_build_version(plist_dict.get("Products",{}).get(prod,{}).get("Distributions",{})) prodd["title"] = smd.get("localization",{}).get("English",{}).get("title",n) @@ -404,7 +408,7 @@ class gibMacOS: var1 = "{}. {} {}".format(num, p["title"], p["version"]) if p["build"].lower() != "unknown": var1 += " ({})".format(p["build"]) - var2 = " - {} - Added {}".format(p["product"], p["date"]) + var2 = " - {} - Added {} - {}".format(p["product"], p["date"], p["size"]) if self.find_recovery and p["installer"]: # Show that it's a full installer var2 += " - FULL Install"