mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-21 21:58:04 +00:00
🚚 Replace resource URL
This commit is contained in:
parent
16af8d965b
commit
013fd2a989
@ -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}",
|
||||||
)
|
)
|
||||||
|
@ -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:
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user