Downloader Func
This commit is contained in:
10
CLI/Init.py
10
CLI/Init.py
@@ -180,9 +180,19 @@ def CheckForUpdate(log=False):
|
|||||||
print(f"Recieved Version {version} - Current Version {currentVersion}")
|
print(f"Recieved Version {version} - Current Version {currentVersion}")
|
||||||
if version > currentVersion:
|
if version > currentVersion:
|
||||||
print(f"Downloading & Installing Update {version}")
|
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]
|
# [Update Functions] <-------------------------------------------------------------------------------------------------------------- [End]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1
CLI/test.mogus
Normal file
1
CLI/test.mogus
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"status":"error","message":"No SteamID provided","version":"1.0.5"}
|
||||||
Reference in New Issue
Block a user