From 8e0116cb5674d5e3dd88d0ff3d8da9bf23777080 Mon Sep 17 00:00:00 2001 From: KevinKor01 Date: Thu, 18 Sep 2025 00:35:27 +0300 Subject: [PATCH] Downloader Func --- CLI/Init.py | 10 ++++++++++ CLI/test.mogus | 1 + 2 files changed, 11 insertions(+) create mode 100644 CLI/test.mogus diff --git a/CLI/Init.py b/CLI/Init.py index b60c60f..5b31eca 100644 --- a/CLI/Init.py +++ b/CLI/Init.py @@ -180,9 +180,19 @@ def CheckForUpdate(log=False): print(f"Recieved Version {version} - Current Version {currentVersion}") if version > currentVersion: print(f"Downloading & Installing Update {version}") + download_file("https://kevinblog.sytes.net/APIS/TiropitLauncher/TiropitAPI.php", "test.mogus") +def download_file(url, filename): + + with requests.get(url, stream=True) as r: + r.raise_for_status() + with open(filename, 'wb') as f: + for chunk in r.iter_content(chunk_size=8192): + f.write(chunk) + print(f"[Downloader] File downloaded at {filename}") + # [Update Functions] <-------------------------------------------------------------------------------------------------------------- [End] diff --git a/CLI/test.mogus b/CLI/test.mogus new file mode 100644 index 0000000..0dfe776 --- /dev/null +++ b/CLI/test.mogus @@ -0,0 +1 @@ +{"status":"error","message":"No SteamID provided","version":"1.0.5"} \ No newline at end of file