From eddeb4281122c14d736fc9470b8f14f4dd683abe Mon Sep 17 00:00:00 2001 From: mikhaillav <59438110+mikhaillav@users.noreply.github.com> Date: Mon, 11 Oct 2021 16:23:26 +0300 Subject: [PATCH] LLL rewrite to python --- source/download.py | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/source/download.py b/source/download.py index fe2a0b7..7292425 100644 --- a/source/download.py +++ b/source/download.py @@ -1,12 +1,37 @@ import urllib.request -a = input("Select type of download ") -if (a == "1"): - print('Beginning downloading files...') - zip = 'https://minecraft.azureedge.net/bin-win/bedrock-server-1.17.34.02.zip' - urllib.request.urlretrieve(zip, 'bedrock_server.zip') -else: - print('Beginning downloading files...') - zip1 = 'https://github.com/LiteLDev/LiteLoaderBDS/releases/download/1.2.4/LiteLoader.zip' - urllib.request.urlretrieve(zip1, 'LiteLoader.zip') +import os +import zipfile +import subprocess + +pth=os.getcwd() + +print('Beginning downloading files...') +zip = 'https://minecraft.azureedge.net/bin-win/bedrock-server-1.17.34.02.zip' +zip1 = 'https://github.com/LiteLDev/LiteLoaderBDS/releases/download/1.2.4/LiteLoader.zip' +urllib.request.urlretrieve(zip, 'bedrock_server.zip') +urllib.request.urlretrieve(zip1, 'LiteLoader.zip') print("Success!") + +print('Starting extract files') +fantasy_zip = zipfile.ZipFile(pth + '\\bedrock_server.zip') +fantasy_zip.extractall(pth) +fantasy_zip = zipfile.ZipFile(pth + '\\LiteLoader.zip') +fantasy_zip.extractall(pth) +fantasy_zip.close() + +print('All file extracted! Starting generate server') +os.system(pth + '\\SymDB2.exe') + + +for i in range( 0, 0 ): + subprocess.call(('SymDB2.exe', str(i))) + +os.system(pth + '\\bedrock_server.exe') + +my_file = open('LL-loader.txt', 'w+') +my_file.write('Hello!' + '\n') +my_file.write('Thx for using LL-loader' + '\n') +my_file.write('Github: https://github.com/Development-studio/LL-Loader') +my_file.close() +