Archive branch
This commit is contained in:
1 parent
8da425391a
commit
a473cf992b
2 files changed
+6
-28
No files matched your search
+4
-2
@@ -2,10 +2,11 @@ import hashlib
|
|||||||
import httpx
|
import httpx
|
||||||
import pytz
|
import pytz
|
||||||
import json
|
import json
|
||||||
|
import asyncio
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from settings import KeychipID
|
from settings import KeychipID
|
||||||
|
|
||||||
def qr_api(qr_code: str):
|
async def QRApi(qr_code: str):
|
||||||
if len(qr_code) > 64:
|
if len(qr_code) > 64:
|
||||||
qr_code = qr_code[-64:]
|
qr_code = qr_code[-64:]
|
||||||
time_stamp = datetime.now(pytz.timezone('Asia/Tokyo')).strftime("%y%m%d%H%M%S")
|
time_stamp = datetime.now(pytz.timezone('Asia/Tokyo')).strftime("%y%m%d%H%M%S")
|
||||||
@@ -23,7 +24,8 @@ def qr_api(qr_code: str):
|
|||||||
"Host": "ai.sys-all.cn",
|
"Host": "ai.sys-all.cn",
|
||||||
"User-Agent": "WC_AIME_LIB"
|
"User-Agent": "WC_AIME_LIB"
|
||||||
}
|
}
|
||||||
res = httpx.post(
|
async with httpx.AsyncClient() as client:
|
||||||
|
res = await client.post(
|
||||||
"http://ai.sys-allnet.cn/wc_aime/api/get_data",
|
"http://ai.sys-allnet.cn/wc_aime/api/get_data",
|
||||||
data = json.dumps(param, separators=(',', ':')),
|
data = json.dumps(param, separators=(',', ':')),
|
||||||
headers = headers
|
headers = headers
|
||||||
|
|||||||
+2
-26
@@ -1,4 +1,3 @@
|
|||||||
import json
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import httpx
|
import httpx
|
||||||
import time
|
import time
|
||||||
@@ -38,32 +37,9 @@ async def run_workflow(self):
|
|||||||
loginId = LoginResponse['loginId']
|
loginId = LoginResponse['loginId']
|
||||||
loginDate = LoginResponse['lastLoginDate']
|
loginDate = LoginResponse['lastLoginDate']
|
||||||
|
|
||||||
# UserData 等
|
# User Charge
|
||||||
|
|
||||||
tasks = [
|
await self.call_api(client, "UpsertUserChargelogApi", requestData_UserChargelog, userId)
|
||||||
self.call_api(client, "GetUserDataApi", requestData_UserData, userId),
|
|
||||||
self.call_api(client, "GetUserExtendApi", requestData_UserData, userId),
|
|
||||||
self.call_api(client, "GetUserOptionApi", requestData_UserData, userId),
|
|
||||||
self.call_api(client, "GetUserRatingApi", requestData_UserData, userId),
|
|
||||||
self.call_api(client, "GetUserChargeApi", requestData_UserData, userId),
|
|
||||||
self.call_api(client, "GetUserActivityApi", requestData_UserData, userId),
|
|
||||||
self.call_api(client, "GetUserMissionDataApi", requestData_UserData, userId),
|
|
||||||
]
|
|
||||||
|
|
||||||
GeneralUserInfo = await asyncio.gather(*tasks)
|
|
||||||
time.sleep(60) # 模拟游戏时间
|
|
||||||
|
|
||||||
# UserPlaylog
|
|
||||||
|
|
||||||
requestData_UserPlaylog = UserPlaylog_payload(loginId, musicData, GeneralUserInfo[0])
|
|
||||||
|
|
||||||
await self.call_api(client, "UploadUserPlaylogListApi", requestData_UserPlaylog, userId)
|
|
||||||
|
|
||||||
# Userall
|
|
||||||
|
|
||||||
requestData_Userall = UserAll_payload(loginId, loginDate, musicData, GeneralUserInfo)
|
|
||||||
|
|
||||||
await self.call_api(client, "UpsertUserAllApi", requestData_Userall, userId)
|
|
||||||
|
|
||||||
# UserLogout
|
# UserLogout
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user