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