mirror of
https://github.com/baiqwerdvd/ArknightsUID.git
synced 2025-05-05 03:23:45 +08:00
update
This commit is contained in:
parent
d836d7dd8d
commit
89f5b8364d
@ -50,7 +50,7 @@ def transUnset(v: Union[T1, UnsetType], d: T2 = None) -> Union[T1, T2]:
|
||||
|
||||
class SklandLogin:
|
||||
_HEADER: ClassVar[Dict[str, str]] = {
|
||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0", # noqa: E501
|
||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36", # noqa: E501
|
||||
"content-type": "application/json;charset=UTF-8",
|
||||
"origin": "https://www.skland.com",
|
||||
"referer": "https://www.skland.com",
|
||||
@ -77,7 +77,7 @@ class SklandLogin:
|
||||
else:
|
||||
data = GeneralV1SendPhoneCodeRequest(
|
||||
phone=self.phone,
|
||||
type=1,
|
||||
type=2,
|
||||
)
|
||||
response = self.client.post(
|
||||
ARK_LOGIN_SEND_PHONE_CODE,
|
||||
@ -116,16 +116,6 @@ class SklandLogin:
|
||||
return result.msg
|
||||
|
||||
def token_by_phone_code(self, code: str):
|
||||
# data = UserAuthV2TokenByPhoneCodeRequest(
|
||||
# phone=self.phone,
|
||||
# code=code,
|
||||
# )
|
||||
# data = {
|
||||
# "phone": self.phone,
|
||||
# "code": code,
|
||||
# }
|
||||
# data = mscjson.decode(mscjson.encode(data))
|
||||
# print(data)
|
||||
response = self.client.post(
|
||||
ARK_TOKEN_BY_PHONE_CODE,
|
||||
json={
|
||||
@ -133,8 +123,8 @@ class SklandLogin:
|
||||
"code": code,
|
||||
},
|
||||
)
|
||||
response.raise_for_status()
|
||||
result = convert(response.json(), UserAuthV2TokenByPhoneCodeResponse)
|
||||
print(result)
|
||||
status = result.status
|
||||
if status == 101:
|
||||
msg = transUnset(result.msg)
|
||||
|
@ -1,4 +1,4 @@
|
||||
ARK_USER_ME = "https://zonai.skland.com/api/v1/user/me"
|
||||
ARK_WEB_USER = "https://zonai.skland.com/web/v1/user"
|
||||
|
||||
ARK_REFRESH_TOKEN = "https://zonai.skland.com/api/v1/auth/refresh"
|
||||
|
||||
|
@ -19,25 +19,21 @@ from ...models.skland.models import (
|
||||
ArknightsPlayerInfoModel,
|
||||
ArknightsUserMeModel,
|
||||
)
|
||||
from .api import ARK_PLAYER_INFO, ARK_REFRESH_TOKEN, ARK_SKD_SIGN, ARK_USER_ME
|
||||
from .api import ARK_PLAYER_INFO, ARK_REFRESH_TOKEN, ARK_SKD_SIGN, ARK_WEB_USER
|
||||
|
||||
proxy_url = core_plugins_config.get_config("proxy").data
|
||||
ssl_verify = core_plugins_config.get_config("MhySSLVerify").data
|
||||
|
||||
|
||||
_HEADER: Dict[str, str] = {
|
||||
"Host": "zonai.skland.com",
|
||||
"platform": "1",
|
||||
"User-Agent": "Skland/1.5.1 (com.hypergryph.skland; build:100501001; Android 33; ) Okhttp/4.11.0",
|
||||
"Accept-Encoding": "gzip",
|
||||
"Connection": "close",
|
||||
"Origin": "https://www.skland.com",
|
||||
"Referer": "https://www.skland.com/",
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": "Skland/1.5.1 (com.hypergryph.skland; build:100501001; Android 33; ) Okhttp/4.11.0",
|
||||
"vName": "1.5.1",
|
||||
"vCode": "100501001",
|
||||
"nId": "1",
|
||||
"os": "33",
|
||||
"manufacturer": "Xiaomi",
|
||||
"Connection": "close",
|
||||
"os": "33",
|
||||
}
|
||||
|
||||
|
||||
@ -204,8 +200,8 @@ class BaseArkApi:
|
||||
if cred is None:
|
||||
return False
|
||||
header["cred"] = cred
|
||||
header = await self.set_sign(ARK_USER_ME, header=header, token=token)
|
||||
raw_data = await self.ark_request(ARK_USER_ME, header=header)
|
||||
header = await self.set_sign(ARK_WEB_USER, header=header, token=token)
|
||||
raw_data = await self.ark_request(ARK_WEB_USER, header=header)
|
||||
if isinstance(raw_data, int) or not raw_data:
|
||||
return False
|
||||
if "code" in raw_data and raw_data["code"] == 10001:
|
||||
@ -256,7 +252,7 @@ class BaseArkApi:
|
||||
"platform": header.get("platform", "1"),
|
||||
"timestamp": timestamp,
|
||||
"dId": dId,
|
||||
"vName": header.get("vName", ""),
|
||||
"vName": "1.5.1",
|
||||
},
|
||||
separators=(",", ":"),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user