mirror of
https://github.com/unmojang/meta.git
synced 2025-09-24 03:31:03 -04:00
fix(updateFabric): request HEAD in try block
This commit is contained in:
parent
8b06798c37
commit
a172bc68a4
@ -65,17 +65,17 @@ def get_binary_file(path, url):
|
||||
|
||||
|
||||
def compute_jar_file(path, url):
|
||||
headers = head_file(url)
|
||||
|
||||
# These should result in the same metadata, except for the timestamp which might be a few minutes off for the
|
||||
# fallback method
|
||||
# These two approaches should result in the same metadata, except for the timestamp which might be a few minutes
|
||||
# off for the fallback method
|
||||
try:
|
||||
# Let's not download a Jar file if we don't need to.
|
||||
headers = head_file(url)
|
||||
tstamp = datetime.datetime.strptime(headers["Last-Modified"], DATETIME_FORMAT_HTTP)
|
||||
sha1 = get_plaintext(url + ".sha1")
|
||||
sha256 = get_plaintext(url + ".sha256")
|
||||
size = int(headers["Content-Length"])
|
||||
except requests.HTTPError: # Some older versions don't have a .sha256 file :(
|
||||
except requests.HTTPError:
|
||||
# Some older versions don't have a .sha256 file :(
|
||||
print(f"Falling back to downloading jar for {url}")
|
||||
|
||||
jar_path = path + ".jar"
|
||||
|
Loading…
x
Reference in New Issue
Block a user