Skip to content

Commit

Permalink
chore: 脚本更新添加代理
Browse files Browse the repository at this point in the history
  • Loading branch information
Night-stars-1 committed Jul 20, 2023
1 parent 19b3757 commit 177af26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/update_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ async def upsra(self,
name: str="",
delete_file: bool=False) -> bool:
global tmp_dir
git_proxy = sra_config_obj.github_proxy
raw_proxy = sra_config_obj.rawgithub_proxy
for index, __ in enumerate(range(3)):
try:
up_url = f"https://api.github.com/repos/{self.github_source}/StarRailAssistant/releases/latest"
up_url = f"{git_proxy}https://api.github.com/repos/{self.github_source}/StarRailAssistant/releases/latest"
up_reponse = await get(up_url)
up_data = up_reponse.json()
version: str = up_data.get("tag_name")
Expand All @@ -152,7 +154,7 @@ async def upsra(self,
log.info(_("[资源文件更新]重试次数已达上限,退出程序"))
raise Exception(_("[资源文件更新]重试次数已达上限,退出程序"))
if version != sra_config_obj.star_version:
dl_url = f"https://github.com/{self.github_source}/StarRailAssistant/archive/refs/tags/{version}.zip"
dl_url = f"{git_proxy}https://github.com/{self.github_source}/StarRailAssistant/archive/refs/tags/{version}.zip"
tmp_zip = Path() / tmp_dir / f"{type}.zip"
zip_path = f"StarRailAssistant-{version.replace('v','')}/"
await self.copy_files(Path(), Path() / "StarRailAssistant_backup", ["utils", "temp", "map", "config.json", "get_width.py", "Honkai_Star_Rail.py", "gui.py"])
Expand Down

0 comments on commit 177af26

Please sign in to comment.