mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-05-08 04:55:47 +08:00
🐛 修复偶发情况下的sr导入抽卡链接
提示authkey失效
This commit is contained in:
parent
6118e6bbbb
commit
2ec220572a
@ -1,15 +1,15 @@
|
|||||||
import asyncio
|
|
||||||
from datetime import datetime
|
|
||||||
import json
|
import json
|
||||||
|
import asyncio
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, List, Optional
|
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
|
from datetime import datetime
|
||||||
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
import msgspec
|
import msgspec
|
||||||
|
|
||||||
from ..sruid_utils.api.mys.models import SingleGachaLog
|
|
||||||
from ..utils.mys_api import mys_api
|
from ..utils.mys_api import mys_api
|
||||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||||
|
from ..sruid_utils.api.mys.models import SingleGachaLog
|
||||||
|
|
||||||
gacha_type_meta_data = {
|
gacha_type_meta_data = {
|
||||||
"群星跃迁": ["1"],
|
"群星跃迁": ["1"],
|
||||||
@ -32,9 +32,15 @@ async def get_new_gachalog_by_link(
|
|||||||
url_parse = parse.parse_qs(url.query)
|
url_parse = parse.parse_qs(url.query)
|
||||||
if "authkey" not in url_parse:
|
if "authkey" not in url_parse:
|
||||||
return {}
|
return {}
|
||||||
authkey = parse.quote(url_parse["authkey"][0], safe='')
|
authkey = url_parse["authkey"][0]
|
||||||
|
authkey = parse.quote(authkey, safe='')
|
||||||
|
if 'gacha_id' in url_parse:
|
||||||
|
gacha_id = url_parse["gacha_id"][0]
|
||||||
|
else:
|
||||||
|
gacha_id = None
|
||||||
|
|
||||||
data = await mys_api.get_gacha_log_by_link_in_authkey(
|
data = await mys_api.get_gacha_log_by_link_in_authkey(
|
||||||
uid, authkey, gacha_type, page, end_id
|
uid, authkey, gacha_type, page, end_id, gacha_id
|
||||||
)
|
)
|
||||||
if isinstance(data, int):
|
if isinstance(data, int):
|
||||||
return {}
|
return {}
|
||||||
|
@ -161,8 +161,11 @@ class MysApi(_MysApi):
|
|||||||
gacha_type: str = "11",
|
gacha_type: str = "11",
|
||||||
page: int = 1,
|
page: int = 1,
|
||||||
end_id: str = "0",
|
end_id: str = "0",
|
||||||
|
gacha_id: Optional[str] = None,
|
||||||
) -> Union[int, GachaLog]:
|
) -> Union[int, GachaLog]:
|
||||||
server_id = RECOGNIZE_SERVER.get(str(uid)[0])
|
server_id = RECOGNIZE_SERVER.get(str(uid)[0])
|
||||||
|
if gacha_id is None:
|
||||||
|
gacha_id = "b06a52bc37892e08837b112d28229cebca6b24a2"
|
||||||
if self.check_os(uid):
|
if self.check_os(uid):
|
||||||
HEADER = copy.deepcopy(self._HEADER_OS)
|
HEADER = copy.deepcopy(self._HEADER_OS)
|
||||||
ck = await self.get_sr_ck(uid, "OWNER")
|
ck = await self.get_sr_ck(uid, "OWNER")
|
||||||
@ -178,7 +181,7 @@ class MysApi(_MysApi):
|
|||||||
url = self.MAPI["STAR_RAIL_GACHA_LOG_URL"]
|
url = self.MAPI["STAR_RAIL_GACHA_LOG_URL"]
|
||||||
game_biz = "hkrpg_cn"
|
game_biz = "hkrpg_cn"
|
||||||
data = await self._mys_request(
|
data = await self._mys_request(
|
||||||
url=url,
|
url=url + f'?authkey={authkey}',
|
||||||
method="GET",
|
method="GET",
|
||||||
header=header,
|
header=header,
|
||||||
params={
|
params={
|
||||||
@ -186,12 +189,11 @@ class MysApi(_MysApi):
|
|||||||
"sign_type": "2",
|
"sign_type": "2",
|
||||||
"auth_appid": "webview_gacha",
|
"auth_appid": "webview_gacha",
|
||||||
"default_gacha_type": 11,
|
"default_gacha_type": 11,
|
||||||
"gacha_id": "dbebc8d9fbb0d4ffa067423482ce505bc5ea",
|
"gacha_id": gacha_id,
|
||||||
"timestamp": str(int(time.time())),
|
"timestamp": str(int(time.time())),
|
||||||
"lang": "zh-cn",
|
"lang": "zh-cn",
|
||||||
"plat_type": "pc",
|
"plat_type": "pc",
|
||||||
"region": server_id,
|
"region": server_id,
|
||||||
"authkey": authkey,
|
|
||||||
"game_biz": game_biz,
|
"game_biz": game_biz,
|
||||||
"gacha_type": gacha_type,
|
"gacha_type": gacha_type,
|
||||||
"page": page,
|
"page": page,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user