mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-05 12:18:21 +02:00
Updater now download by chunk
This commit is contained in:
parent
1005ac3c94
commit
fa64225c58
1 changed files with 3 additions and 5 deletions
|
@ -14,10 +14,10 @@ try:
|
||||||
gitversion = requests.get(VERSION_FILE_URL, allow_redirects=True).json()
|
gitversion = requests.get(VERSION_FILE_URL, allow_redirects=True).json()
|
||||||
URL = gitversion["download_bin"]
|
URL = gitversion["download_bin"]
|
||||||
|
|
||||||
dl = requests.get(URL, allow_redirects=True)
|
dl = requests.get(URL, allow_redirects=True, stream=True)
|
||||||
with open("./download.zip", "wb") as file:
|
with open("./download.zip", "wb") as file:
|
||||||
print(f"Téléchargement de la version {gitversion['version']}.{gitversion['subversion']} en cours...")
|
print(f"Téléchargement de la version {gitversion['version']}.{gitversion['subversion']} en cours...")
|
||||||
file.write(dl.content)
|
for chunk in dl.iter_content(chunk_size=1024): file.write(chunk)
|
||||||
print("fin du téléchargement, début de l'extraction...")
|
print("fin du téléchargement, début de l'extraction...")
|
||||||
|
|
||||||
with zipfile.ZipFile("./download.zip") as file:
|
with zipfile.ZipFile("./download.zip") as file:
|
||||||
|
@ -31,5 +31,3 @@ try:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Impossible d'effectuer la mise à jour :\n\n{str(e)}")
|
print(f"Impossible d'effectuer la mise à jour :\n\n{str(e)}")
|
||||||
input("Appuyez pour continuer...")
|
input("Appuyez pour continuer...")
|
||||||
|
|
||||||
# TODO: Utiliser un buffer pour éviter de consommer trop de RAM pendant le téléchargement
|
|
Loading…
Reference in a new issue