forked from Fragrance/eaquira
chore: delete the non-functional ticket script
This commit is contained in:
@@ -1,93 +0,0 @@
|
|||||||
import json
|
|
||||||
import asyncio
|
|
||||||
import httpx
|
|
||||||
import time
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from sdgb import MaimaiClient
|
|
||||||
from sdgb.settings import userId, musicData
|
|
||||||
from sdgb.payload import (
|
|
||||||
requestData_UserPreview,
|
|
||||||
requestData_UserLogin,
|
|
||||||
requestData_UserData,
|
|
||||||
requestData_UserLogout,
|
|
||||||
UserAll_payload,
|
|
||||||
)
|
|
||||||
|
|
||||||
maimai = MaimaiClient()
|
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(
|
|
||||||
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
|
|
||||||
)
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
async def run_workflow(self: MaimaiClient):
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=False) as client:
|
|
||||||
# Preview 探测
|
|
||||||
|
|
||||||
PreviewResponse = json.loads(
|
|
||||||
await self.call_api(
|
|
||||||
client, "GetUserPreviewApi", requestData_UserPreview, userId
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if PreviewResponse["isLogin"]:
|
|
||||||
logger.error("已在他处登录。")
|
|
||||||
return
|
|
||||||
|
|
||||||
# UserLogin
|
|
||||||
|
|
||||||
LoginResponse = json.loads(
|
|
||||||
await self.call_api(client, "UserLoginApi", requestData_UserLogin, userId)
|
|
||||||
)
|
|
||||||
if LoginResponse["returnCode"] == 106:
|
|
||||||
logger.error("chime verfication failed.")
|
|
||||||
return
|
|
||||||
|
|
||||||
loginId = LoginResponse["loginId"]
|
|
||||||
loginDate = LoginResponse["lastLoginDate"]
|
|
||||||
|
|
||||||
# UserData 等
|
|
||||||
|
|
||||||
tasks = [
|
|
||||||
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
|
|
||||||
|
|
||||||
await self.call_api(client, "UserLogoutApi", requestData_UserLogout, userId)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
asyncio.run(run_workflow(maimai))
|
|
||||||
Reference in New Issue
Block a user