From 5659d9f3cc7ac6ed85d87c816560503bf91fa767 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 15 Feb 2023 16:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Change=20resources=20repo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metadata/scripts/metadatas.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/metadata/scripts/metadatas.py b/metadata/scripts/metadatas.py index c9e26612..46dc90e1 100644 --- a/metadata/scripts/metadatas.py +++ b/metadata/scripts/metadatas.py @@ -1,3 +1,4 @@ +from base64 import b64decode as parse_token from contextlib import contextmanager from typing import Iterator @@ -9,8 +10,9 @@ from utils.const import AMBR_HOST, PROJECT_ROOT from utils.log import logger __all__ = ["update_metadata_from_ambr", "update_metadata_from_github", "make_github_fast"] -RESOURCE_REPO = "RTPaimon/Grasscutter_Resources" -RESOURCE_BRANCH = "3.3" +GENSHIN_PY_DATA_REPO = parse_token("aHR0cHM6Ly9naXRsYWIuY29tL0RpbWJyZWF0aC9nYW1lZGF0YS8tL3Jhdy9tYXN0ZXIv").decode() +RESOURCE_REPO = "PaiGramTeam/PaiGram_Resources" +RESOURCE_BRANCH = "remote" RESOURCE_ROOT = "Resources" RESOURCE_DEFAULT_PATH = f"{RESOURCE_REPO}/{RESOURCE_BRANCH}/{RESOURCE_ROOT}/" @@ -131,4 +133,7 @@ async def update_metadata_from_github(overwrite: bool = True): def make_github_fast(url: str) -> str: url = url.replace("raw.githubusercontent.com", "raw.fastgit.org") url = url.replace("Dimbreath/GenshinData/master/", RESOURCE_DEFAULT_PATH) - return url + return url.replace( + GENSHIN_PY_DATA_REPO, + f"https://raw.fastgit.org/{RESOURCE_DEFAULT_PATH}", + )