This commit is contained in:
恍兮惚兮 2024-07-01 02:21:03 +08:00
parent 192df621bb
commit 699976da91

View File

@ -25,6 +25,11 @@ curlFileName64 = "curl-8.7.1_7-win64-mingw.zip"
ocrModelUrl = "https://github.com/HIllya51/RESOURCES/releases/download/ocr_models"
availableLocales = ["cht", "en", "ja", "ko", "ru", "zh"]
LunaHook_latest = (
"https://github.com/HIllya51/LunaHook/releases/download/latest/Release_English.zip"
)
LocaleRe = "https://github.com/InWILL/Locale_Remulator/releases/download/v1.5.3-beta.1/Locale_Remulator.1.5.3-beta.1.zip"
# rootDir = os.path.dirname(os.path.abspath(__file__))
# print(__file__)
@ -72,13 +77,9 @@ def downloadBrotli():
def downloadlr():
for ass in get_url_as_json(
"https://api.github.com/repos/InWILL/Locale_Remulator/releases/latest"
)["assets"]:
if "browser_download_url" in ass:
os.chdir(rootDir + "\\temp")
subprocess.run(f"curl -LO {ass['browser_download_url']}")
subprocess.run(f"7z x {ass['name']} -oLR")
subprocess.run(f"curl -LO {LocaleRe}")
subprocess.run(f"7z x {LocaleRe.split('/')[-1]} -oLR")
os.makedirs(
f"{rootDir}/LunaTranslator/files/plugins/Locale_Remulator",
exist_ok=True,
@ -197,13 +198,10 @@ def get_url_as_json(url):
def buildLunaHook():
for ass in get_url_as_json(
"https://api.github.com/repos/HIllya51/LunaHook/releases/latest"
)["assets"]:
if ass["name"] == "Release_English.zip":
os.chdir(rootDir + "\\temp")
subprocess.run(f"curl -LO {ass['browser_download_url']}")
subprocess.run(f"7z x Release_English.zip")
subprocess.run(f"curl -LO {LunaHook_latest}")
subprocess.run(f"7z x {LunaHook_latest.split('/')[-1]}")
shutil.move(
"Release_English/LunaHook32.dll",
f"{rootDir}/LunaTranslator/files/plugins/LunaHook",