🚚 Replace resource URL

This commit is contained in:
洛水居室 2023-03-27 09:04:08 +08:00
parent 16af8d965b
commit 013fd2a989
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
3 changed files with 3 additions and 4 deletions

View File

@ -131,9 +131,8 @@ async def update_metadata_from_github(overwrite: bool = True):
def make_github_fast(url: str) -> str: 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) url = url.replace("Dimbreath/GenshinData/master/", RESOURCE_DEFAULT_PATH)
return url.replace( return url.replace(
GENSHIN_PY_DATA_REPO, GENSHIN_PY_DATA_REPO,
f"https://raw.fastgit.org/{RESOURCE_DEFAULT_PATH}", f"https://raw.githubusercontent.com/{RESOURCE_DEFAULT_PATH}",
) )

View File

@ -9,7 +9,7 @@ GACHA_LOG_PAIMON_MOE_PATH = PROJECT_ROOT.joinpath("metadata/data/paimon_moe_zh.j
async def update_paimon_moe_zh(overwrite: bool = True): async def update_paimon_moe_zh(overwrite: bool = True):
if not overwrite and GACHA_LOG_PAIMON_MOE_PATH.exists(): if not overwrite and GACHA_LOG_PAIMON_MOE_PATH.exists():
return return
host = URL("https://raw.fastgit.org/MadeBaruna/paimon-moe/main/src/locales/items/zh.json") host = URL("https://raw.githubusercontent.com/MadeBaruna/paimon-moe/main/src/locales/items/zh.json")
client = AsyncClient() client = AsyncClient()
text = (await client.get(host)).text text = (await client.get(host)).text
async with async_open(GACHA_LOG_PAIMON_MOE_PATH, mode="w", encoding="utf-8") as file: async with async_open(GACHA_LOG_PAIMON_MOE_PATH, mode="w", encoding="utf-8") as file:

View File

@ -8,7 +8,7 @@ from metadata.scripts.metadatas import RESOURCE_DEFAULT_PATH
class Remote: class Remote:
"""拉取云控资源""" """拉取云控资源"""
BASE_URL = f"https://raw.fastgit.org/{RESOURCE_DEFAULT_PATH}" BASE_URL = f"https://raw.githubusercontent.com/{RESOURCE_DEFAULT_PATH}"
CALENDAR = f"{BASE_URL}calendar.json" CALENDAR = f"{BASE_URL}calendar.json"
BIRTHDAY = f"{BASE_URL}birthday.json" BIRTHDAY = f"{BASE_URL}birthday.json"