Skip to content

Commit

Permalink
🐛 修复ba总力战
Browse files Browse the repository at this point in the history
  • Loading branch information
KimigaiiWuyi committed Sep 13, 2024
1 parent c271e28 commit 076e88a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BlueArchiveUID/utils/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 13 additions & 2 deletions BlueArchiveUID/utils/api/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 076e88a

Please sign in to comment.