Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
CHNZYX committed Jan 1, 2024
1 parent 390c575 commit 41432e9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 9 additions & 3 deletions states.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ def __init__(
except:
log.info("网络异常,尝试备用网址")
try:
lowest = requests.get(
"https://chnzyx.github.io/asu_version_check/"
).text.strip()
lowest = (
requests.get(
"https://github.moeyy.xyz/https://api.github.com/repos/CHNZYX/Auto_Simulated_Universe/releases/latest"
)
.json()["name"]
.split("lowest")[1]
.strip()
.strip("v")
)
log.info("版本下限:v" + lowest)
except:
log.info("网络异常")#,强制退出")
Expand Down
2 changes: 1 addition & 1 deletion update.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo downloading...

powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://ghproxy.com/https://github.com/CHNZYX/Auto_Simulated_Universe/archive/main.zip', '.\repository.zip')"
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://github.moeyy.xyz/https://github.com/CHNZYX/Auto_Simulated_Universe/archive/main.zip', '.\repository.zip')"

powershell -Command "Expand-Archive -Path '.\repository.zip' -DestinationPath '../' -Force"

Expand Down
5 changes: 3 additions & 2 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def download_file(url, save_path):
def start_download():
popup.destroy()
operation_label.config(text="下载中...")
download_url = f"https://ghproxy.com/https://github.com/CHNZYX/Auto_Simulated_Universe/releases/download/{info['tag_name']}/Auto_Simulated_Universe_{info['tag_name']}.zip"
download_url = f"https://github.moeyy.xyz/https://github.com/CHNZYX/Auto_Simulated_Universe/releases/download/{info['tag_name']}/Auto_Simulated_Universe_{info['tag_name']}.zip"
save_path = "./archive.zip"
t = threading.Thread(target=download_file, args=(download_url, save_path))
t.start()
Expand All @@ -91,7 +91,8 @@ def main_operation():
except:
try:
info = dict()
info['tag_name']= 'v'+requests.get("https://chnzyx.github.io/asu_version_latest/").text.strip()
repo_url = "https://github.moeyy.xyz/https://api.github.com/repos/CHNZYX/Auto_Simulated_Universe/releases/latest"
info = get_latest_release_info(repo_url)
version_remote = info['tag_name'].strip('v').split(' ')[0]
operation_label.config(text=f"网络异常,当前可用最高版本:{info['tag_name']}")
except:
Expand Down

0 comments on commit 41432e9

Please sign in to comment.