面板查询带上UA

This commit is contained in:
qwerdvd 2023-05-14 17:14:03 +08:00
parent f787539051
commit d5de4b7efb
2 changed files with 6 additions and 0 deletions

View File

@ -4,12 +4,15 @@ from typing import Dict
from httpx import AsyncClient
from ..utils import _HEADER
# from .models import EnkaData
async def get_char_card_info(uid: str) -> Dict:
async with AsyncClient(
base_url='http://api.mihomo.me',
headers=_HEADER,
timeout=30,
) as client:
req = await client.get(f'/sr_info/{uid}')

View File

@ -0,0 +1,3 @@
from gsuid_core.version import __version__
_HEADER = {'User-Agent': f'StarRailUID/{__version__}'}