Skip to content

Commit

Permalink
👽 修复mys.request.get_gacha_log_by_authkey()
Browse files Browse the repository at this point in the history
  • Loading branch information
KimigaiiWuyi committed Apr 24, 2024
1 parent b4aebf0 commit 503275a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion gsuid_core/utils/api/mys/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
# 通过Stoken获取AuthKey
GET_AUTHKEY_URL = f'{OLD_URL}/binding/api/genAuthKey'
# 通过AuthKey获取gachalogs
GET_GACHA_LOG_URL = f'{HK4_URL}/event/gacha_info/api/getGachaLog'
GET_GACHA_LOG_URL = (
'https://public-operation-hk4e.mihoyo.com/gacha_info/api/getGachaLog'
)
GET_GACHA_LOG_URL_OS = f'{HK4_URL_OS}/event/gacha_info/api/getGachaLog'
# 通过GameToken获取Stoken
GET_STOKEN = f'{PASSPORT_URL}/account/ma-cn-session/app/getTokenByGameToken'
Expand Down
8 changes: 5 additions & 3 deletions gsuid_core/utils/api/mys/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import annotations

import copy
import json
import time
import uuid
import random
Expand Down Expand Up @@ -423,7 +424,7 @@ async def _mys_request(
)
try:
raw_data = resp.json()
except ContentTypeError:
except (ContentTypeError, json.decoder.JSONDecodeError):
_raw_data = resp.text
raw_data = {'retcode': -999, 'data': _raw_data}

Expand Down Expand Up @@ -1006,15 +1007,16 @@ async def get_gacha_log_by_authkey(
if isinstance(authkey_rawdata, int):
return authkey_rawdata
authkey = authkey_rawdata['authkey']
url = self.MAPI['GET_GACHA_LOG_URL']
data = await self._mys_request(
url=self.MAPI['GET_GACHA_LOG_URL'],
url=url,
method='GET',
header=self._HEADER,
params={
'authkey_ver': '1',
'sign_type': '2',
'auth_appid': 'webview_gacha',
'init_type': '200',
'init_type': gacha_type,
'gacha_id': 'fecafa7b6560db5f3182222395d88aaa6aaac1bc',
'timestamp': str(int(time.time())),
'lang': 'zh-cn',
Expand Down

0 comments on commit 503275a

Please sign in to comment.