Compare commits
10 Commits
05d7c1305b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a60088303 | ||
|
|
2176130d10 | ||
|
|
2a98362199 | ||
|
|
28926bc14d | ||
|
|
65eced4fca | ||
|
|
1f09a7538c | ||
|
|
1eba8453a5 | ||
|
|
f6a3b55507 | ||
|
|
626f33097b | ||
|
|
e1c51f255f |
@@ -91,6 +91,7 @@ def apiSDGB(
|
|||||||
) -> str:
|
) -> str:
|
||||||
"""
|
"""
|
||||||
舞萌DX 2025 API 通讯用函数
|
舞萌DX 2025 API 通讯用函数
|
||||||
|
|
||||||
:param data: 请求数据
|
:param data: 请求数据
|
||||||
:param targetApi: 使用的 API
|
:param targetApi: 使用的 API
|
||||||
:param userAgentExtraData: UA 附加信息,机台相关则为狗号(如A63E01E9564),用户相关则为 UID
|
:param userAgentExtraData: UA 附加信息,机台相关则为狗号(如A63E01E9564),用户相关则为 UID
|
||||||
|
|||||||
@@ -7,18 +7,22 @@ from HelperLogInOut import apiLogin, apiLogout, generateTimestamp
|
|||||||
from HelperUnlockThing import implUnlockThing
|
from HelperUnlockThing import implUnlockThing
|
||||||
|
|
||||||
|
|
||||||
def implUnlockSingleItem(
|
def implUnlockMultiItem(
|
||||||
itemId: int,
|
|
||||||
itemKind: int,
|
itemKind: int,
|
||||||
userId: int,
|
userId: int,
|
||||||
currentLoginTimestamp: int,
|
currentLoginTimestamp: int,
|
||||||
currentLoginResult,
|
currentLoginResult,
|
||||||
|
*itemIds: int,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
if not itemIds:
|
||||||
|
logger.info("无操作,跳过处理!")
|
||||||
|
return
|
||||||
"""
|
"""
|
||||||
发单个东西,比如搭档 10
|
发单个东西,比如搭档 10
|
||||||
"""
|
"""
|
||||||
userItemList = [
|
userItemList = [
|
||||||
{"itemKind": itemKind, "itemId": itemId, "stock": 1, "isValid": True}
|
{"itemKind": itemKind, "itemId": itemId, "stock": 1, "isValid": True}
|
||||||
|
for itemId in itemIds
|
||||||
]
|
]
|
||||||
unlockThingResult = implUnlockThing(
|
unlockThingResult = implUnlockThing(
|
||||||
userItemList, userId, currentLoginTimestamp, currentLoginResult
|
userItemList, userId, currentLoginTimestamp, currentLoginResult
|
||||||
@@ -51,8 +55,15 @@ if __name__ == "__main__":
|
|||||||
logger.info("登录失败")
|
logger.info("登录失败")
|
||||||
exit()
|
exit()
|
||||||
try:
|
try:
|
||||||
|
items = range(11, 33) # all partners
|
||||||
logger.info(
|
logger.info(
|
||||||
implUnlockSingleItem(14, 10, userId, currentLoginTimestamp, loginResult)
|
implUnlockMultiItem(
|
||||||
|
10,
|
||||||
|
userId,
|
||||||
|
currentLoginTimestamp,
|
||||||
|
loginResult,
|
||||||
|
*items,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
logger.info(apiLogout(currentLoginTimestamp, userId))
|
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
@@ -190,3 +190,10 @@ def generateDebugTestScore():
|
|||||||
"syncStatus": 4,
|
"syncStatus": 4,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
userId = int(input("userId: "))
|
||||||
|
fishImportToken = input("DivingFish Token: ")
|
||||||
|
|
||||||
|
implUserMusicToDivingFish(userId, fishImportToken)
|
||||||
|
|||||||
10
Config.py
10
Config.py
@@ -1,8 +1,8 @@
|
|||||||
regionId = 22
|
regionId = 13
|
||||||
regionName = "山东"
|
regionName = "河南"
|
||||||
placeId = 3490
|
placeId = 2411
|
||||||
placeName = "赛博时空枣庄市中店"
|
placeName = "智游星期六河南郑州店"
|
||||||
clientId = "A63E01E9564"
|
clientId = "A63E01E6154"
|
||||||
|
|
||||||
useProxy = False
|
useProxy = False
|
||||||
proxyUrl = "http://100.104.133.113:33080"
|
proxyUrl = "http://100.104.133.113:33080"
|
||||||
|
|||||||
31
GetAny.py
Normal file
31
GetAny.py
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# 获取用户简略预览数据的 API 实现,此 API 无需任何登录即可调取
|
||||||
|
|
||||||
|
from loguru import logger
|
||||||
|
import rapidjson as json
|
||||||
|
from API_TitleServer import apiSDGB
|
||||||
|
|
||||||
|
|
||||||
|
def apiGetAny(
|
||||||
|
userId,
|
||||||
|
apiName: str,
|
||||||
|
noLog: bool = False,
|
||||||
|
) -> str:
|
||||||
|
data = json.dumps({"userId": int(userId)})
|
||||||
|
preview_result = apiSDGB(data, apiName, userId, noLog)
|
||||||
|
return preview_result
|
||||||
|
|
||||||
|
|
||||||
|
# CLI 示例
|
||||||
|
if __name__ == "__main__":
|
||||||
|
userId = input("请输入用户 ID:")
|
||||||
|
# userId = testUid8
|
||||||
|
# print(apiGetAny(userId, "GetUserRatingApi"))
|
||||||
|
# print(apiGetAny(userId, "GetUserPreviewApi"))
|
||||||
|
|
||||||
|
for type in ["course", "extend", "character", "activity", "charge", "option", "region"]:
|
||||||
|
try:
|
||||||
|
data = apiGetAny(userId, f"GetUser{type.title()}Api", noLog=True)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"failed when scraping {type}: {e}")
|
||||||
|
else:
|
||||||
|
print(f"{type}:", json.dumps(json.loads(data), ensure_ascii=False, indent=4))
|
||||||
18
GetRating.py
Normal file
18
GetRating.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# 获取用户简略预览数据的 API 实现,此 API 无需任何登录即可调取
|
||||||
|
|
||||||
|
import rapidjson as json
|
||||||
|
from API_TitleServer import apiSDGB
|
||||||
|
|
||||||
|
|
||||||
|
def apiGetUserPreview(userId, noLog: bool = False) -> str:
|
||||||
|
data = json.dumps({"userId": int(userId)})
|
||||||
|
preview_result = apiSDGB(data, "GetUserRatingApi", userId, noLog)
|
||||||
|
return preview_result
|
||||||
|
|
||||||
|
|
||||||
|
# CLI 示例
|
||||||
|
if __name__ == "__main__":
|
||||||
|
userId = input("请输入用户 ID:")
|
||||||
|
# userId = testUid8
|
||||||
|
print(apiGetUserPreview(userId))
|
||||||
|
print(apiSDGB("{}", "Ping", userId, False))
|
||||||
34
GetUserAll.py
Normal file
34
GetUserAll.py
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
from loguru import logger
|
||||||
|
|
||||||
|
from HelperFullPlay import implFullPlayAction
|
||||||
|
from HelperLogInOut import apiLogin, apiLogout, generateTimestamp
|
||||||
|
from MyConfig import testUid8
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
userId = int(input("type user id: ").strip() or "0") or testUid8
|
||||||
|
currentLoginTimestamp = generateTimestamp()
|
||||||
|
loginResult = apiLogin(currentLoginTimestamp, userId)
|
||||||
|
|
||||||
|
if loginResult["returnCode"] != 1:
|
||||||
|
logger.info("登录失败")
|
||||||
|
exit()
|
||||||
|
try:
|
||||||
|
items = [23]
|
||||||
|
musicData = {
|
||||||
|
"musicId": 11538, # Amber Chronicle
|
||||||
|
"level": 0,
|
||||||
|
"playCount": 1,
|
||||||
|
"achievement": 0,
|
||||||
|
"comboStatus": 0,
|
||||||
|
"syncStatus": 0,
|
||||||
|
"deluxscoreMax": 0,
|
||||||
|
"scoreRank": 0,
|
||||||
|
"extNum1": 0,
|
||||||
|
}
|
||||||
|
implFullPlayAction(
|
||||||
|
userId, currentLoginTimestamp, loginResult, musicData, {}, debugMode=True
|
||||||
|
)
|
||||||
|
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||||
|
finally:
|
||||||
|
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||||
|
# logger.warning("Error")
|
||||||
30
GetUserData.py
Normal file
30
GetUserData.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# 获取用户简略预览数据的 API 实现,此 API 无需任何登录即可调取
|
||||||
|
|
||||||
|
from loguru import logger
|
||||||
|
import rapidjson as json
|
||||||
|
|
||||||
|
from API_TitleServer import apiSDGB
|
||||||
|
from HelperLogInOut import apiLogin, apiLogout, generateTimestamp
|
||||||
|
from MyConfig import testUid8
|
||||||
|
|
||||||
|
|
||||||
|
def apiGetUserData(userId, noLog: bool = False) -> str:
|
||||||
|
data = json.dumps({"userId": int(userId)})
|
||||||
|
preview_result = apiSDGB(data, "GetUserDataApi", userId, noLog)
|
||||||
|
return preview_result
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
userId = int(input("type user id: ").strip() or "0") or testUid8
|
||||||
|
currentLoginTimestamp = generateTimestamp()
|
||||||
|
loginResult = apiLogin(currentLoginTimestamp, userId)
|
||||||
|
|
||||||
|
if loginResult["returnCode"] != 1:
|
||||||
|
logger.info("登录失败")
|
||||||
|
exit()
|
||||||
|
try:
|
||||||
|
logger.info(apiGetUserData(userId, noLog=False))
|
||||||
|
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||||
|
finally:
|
||||||
|
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||||
|
# logger.warning("Error")
|
||||||
@@ -60,25 +60,38 @@ itemKindzhCNDict = {
|
|||||||
# "STRONG": "MUSIC_STRONG",
|
# "STRONG": "MUSIC_STRONG",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Splash = 2020
|
||||||
|
# UNiVERSE = 2022
|
||||||
|
# FESTiVAL = 2023
|
||||||
|
# BUDDiES = 2024
|
||||||
|
# PRiSM = 2025
|
||||||
|
|
||||||
partnerList = {
|
partnerList = {
|
||||||
"1": "迪拉熊",
|
"1": "迪拉熊",
|
||||||
"17": "青柠熊&柠檬熊",
|
"17": "青柠熊&柠檬熊",
|
||||||
|
"29": "青柠熊&柠檬熊(2024)",
|
||||||
"11": "乙姫",
|
"11": "乙姫",
|
||||||
"12": "拉兹",
|
|
||||||
"13": "雪纺",
|
|
||||||
"14": "莎露朵",
|
|
||||||
"15": "夏玛",
|
|
||||||
"16": "咪璐库",
|
|
||||||
"18": "乙姫(Splash)",
|
"18": "乙姫(Splash)",
|
||||||
"19": "夏玛(UNiVERSE)",
|
"28": "乙姫(2024)",
|
||||||
"20": "咪璐库(UNiVERSE)",
|
"12": "拉兹",
|
||||||
"21": "小咪璐库",
|
|
||||||
"22": "百合咲美香",
|
|
||||||
"23": "拉兹(2023)",
|
"23": "拉兹(2023)",
|
||||||
|
"30": "拉兹 (BUDDiES)",
|
||||||
|
"13": "雪纺",
|
||||||
"24": "雪纺(2023)",
|
"24": "雪纺(2023)",
|
||||||
|
"14": "莎露朵",
|
||||||
"25": "莎露朵(2023)",
|
"25": "莎露朵(2023)",
|
||||||
|
"31": "莎露朵 (PRiSM)",
|
||||||
|
"15": "夏玛",
|
||||||
|
"19": "夏玛(UNiVERSE)",
|
||||||
|
"16": "咪璐库",
|
||||||
|
"21": "小咪璐库",
|
||||||
|
"32": "咪璐库 (PRiSM)",
|
||||||
|
"20": "咪璐库(UNiVERSE)",
|
||||||
|
"22": "百合咲美香",
|
||||||
"26": "黒姫",
|
"26": "黒姫",
|
||||||
"27": "俊达萌",
|
"27": "俊达萌",
|
||||||
"28": "乙姫(2024)",
|
"33": "超天酱",
|
||||||
"29": "青柠熊&柠檬熊(2024)",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for id, partner in partnerList.items():
|
||||||
|
print()
|
||||||
Reference in New Issue
Block a user