From 076e88a2b9d949ba98b09eeed0e41dcd3f21577a Mon Sep 17 00:00:00 2001 From: KimigaiiWuyi <444835641@qq.com> Date: Fri, 13 Sep 2024 21:32:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D`ba=E6=80=BB?= =?UTF-8?q?=E5=8A=9B=E6=88=98`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BlueArchiveUID/utils/api/api.py | 2 +- BlueArchiveUID/utils/api/request.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/BlueArchiveUID/utils/api/api.py b/BlueArchiveUID/utils/api/api.py index 09a641b..a63ca97 100644 --- a/BlueArchiveUID/utils/api/api.py +++ b/BlueArchiveUID/utils/api/api.py @@ -13,7 +13,7 @@ XTZX_RAID_RANK = XTZX_API + '/api/v2/rank/list' XTZX_RAID_TOP = XTZX_API + '/api/v2/rank/list_top' XTZX_RAID_CHART_PERSON = XTZX_API + '/api/v2/rank/season/lastRank/charts' -XTZX_RAID_CHART = XTZX_API + '/raid/new/charts/{}?s={}' +XTZX_RAID_CHART = XTZX_API + '/api/v2/rank/new/charts' XTZX_RAID_RANK_PERSON = XTZX_API + '/api/v2/rank/list_by_last_rank' XTZX_FRIEND_DATA = XTZX_API + '/api/friends/find' XTZX_FRIEND_REFRESH = XTZX_API + '/api/friends/refresh' diff --git a/BlueArchiveUID/utils/api/request.py b/BlueArchiveUID/utils/api/request.py index 91cf0e0..70be95e 100644 --- a/BlueArchiveUID/utils/api/request.py +++ b/BlueArchiveUID/utils/api/request.py @@ -76,7 +76,11 @@ class XTZXApi(BaseBAApi): _HEADER = {'Authorization': f'ba-token {TOKEN}'} async def get_xtzx_raid_list(self) -> Optional[List[Dict]]: - data = await self._ba_request(XTZX_RAID_LIST) + data = await self._ba_request( + XTZX_RAID_LIST, + 'POST', + json={'server': 1}, + ) if isinstance(data, Dict): return data['data'] @@ -122,8 +126,15 @@ async def get_xtzx_raid_chart( if now_season is None: return None season = now_season['season'] + if season is None: + return None data = await self._ba_request( - XTZX_RAID_CHART.format(server_id, season) + XTZX_RAID_CHART, + 'POST', + json={ + 'server': int(server_id), + 'season': int(season), + }, ) if ( isinstance(data, Dict)