This commit is contained in:
baiqwerdvd 2024-12-09 16:26:46 +08:00
parent 5215e7902d
commit 24fd6bcfe2
No known key found for this signature in database
GPG Key ID: 7717E46E1797411A

View File

@ -182,6 +182,7 @@ class SklandLogin:
async def generate_cred_by_code(self): async def generate_cred_by_code(self):
headers = { headers = {
"User-Agent": "Skland/1.28.0 (com.hypergryph.skland; build:102800063; Android 35; ) Okhttp/4.11.0", "User-Agent": "Skland/1.28.0 (com.hypergryph.skland; build:102800063; Android 35; ) Okhttp/4.11.0",
"content-type": "application/json;charset=UTF-8",
"platform": "1", "platform": "1",
"vName": "1.28.0", "vName": "1.28.0",
"origin": "https://zonai.skland.com/", "origin": "https://zonai.skland.com/",
@ -190,11 +191,12 @@ class SklandLogin:
"dId": await get_d_id(), "dId": await get_d_id(),
"timestamp": str(int(datetime.now().timestamp())), "timestamp": str(int(datetime.now().timestamp())),
} }
self.client.headers = headers # self.client.headers = headers
response = self.client.post( async with httpx.AsyncClient(headers=headers, verify=False) as client:
GENERATE_CRED_BY_CODE, response = await client.post(
json={"code": self.code, "kind": 1}, GENERATE_CRED_BY_CODE,
) json={"code": self.code, "kind": 1},
)
response.raise_for_status() response.raise_for_status()
print(response.json()) print(response.json())
result = convert(response.json(), ZonaiSklandWebUserGenerateCredByCodeResponse) result = convert(response.json(), ZonaiSklandWebUserGenerateCredByCodeResponse)