mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 07:07:46 +00:00
🎨 Update the outdated project name
This commit is contained in:
parent
efa7775ddb
commit
6e9c42c4dd
@ -18,6 +18,7 @@ from httpx import AsyncClient, HTTPError, HTTPStatusError, TransportError, URL
|
||||
from typing_extensions import Self
|
||||
|
||||
from core.base_service import BaseService
|
||||
from core.config import config
|
||||
from metadata.genshin import AVATAR_DATA, HONEY_DATA, MATERIAL_DATA, NAMECARD_DATA, WEAPON_DATA
|
||||
from metadata.scripts.honey import update_honey_metadata
|
||||
from metadata.scripts.metadatas import update_metadata_from_ambr, update_metadata_from_github
|
||||
@ -130,7 +131,9 @@ class _AssetsService(ABC):
|
||||
async def _download(self, url: StrOrURL, path: Path, retry: int = 5) -> Path | None:
|
||||
"""从 url 下载图标至 path"""
|
||||
logger.debug("正在从 %s 下载图标至 %s", url, path)
|
||||
headers = {"user-agent": "TGPaimonBot/3.0"} if URL(url).host == "enka.network" else None
|
||||
headers = None
|
||||
if config.enka_network_api_agent is not None and URL(url).host == "enka.network":
|
||||
headers = {"user-agent": config.enka_network_api_agent}
|
||||
for time in range(retry):
|
||||
try:
|
||||
response = await self.client.get(url, follow_redirects=False, headers=headers)
|
||||
|
@ -22,7 +22,6 @@ class RedisDB(BaseService.Dependence):
|
||||
):
|
||||
self.client = aioredis.Redis(host=host, port=port, db=database, password=password)
|
||||
self.ttl = 600
|
||||
self.key_prefix = "paimon_bot"
|
||||
|
||||
async def ping(self):
|
||||
# noinspection PyUnresolvedReferences
|
||||
|
@ -128,9 +128,7 @@ class GachaLog:
|
||||
if not state:
|
||||
raise GachaLogNotFound
|
||||
save_path = self.gacha_log_path / f"{user_id}-{uid}-uigf.json"
|
||||
info = UIGFModel(
|
||||
info=UIGFInfo(uid=uid, export_app=ImportType.TGPaimonBot.value, export_app_version="v3"), list=[]
|
||||
)
|
||||
info = UIGFModel(info=UIGFInfo(uid=uid, export_app=ImportType.PaiGram.value, export_app_version="v3"), list=[])
|
||||
for items in data.item_list.values():
|
||||
for item in items:
|
||||
info.list.append(
|
||||
|
@ -9,7 +9,7 @@ from modules.gacha_log.const import UIGF_VERSION
|
||||
|
||||
|
||||
class ImportType(Enum):
|
||||
TGPaimonBot = "TGPaimonBot"
|
||||
PaiGram = "PaiGram"
|
||||
PAIMONMOE = "PAIMONMOE"
|
||||
FXQ = "FXQ"
|
||||
UIGF = "UIGF"
|
||||
|
Loading…
Reference in New Issue
Block a user