maimaiDX-Api/GetPreview.py
2025-02-02 03:17:13 +08:00

19 lines
492 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 获取用户简略预览数据的 API 实现,此 API 无需任何登录即可调取
import json
from API_TitleServer import apiSDGB
from Config import *
def apiGetUserPreview(userId) -> str:
data = json.dumps({
"userId": int(userId)
})
preview_result = apiSDGB(data, "GetUserPreviewApi", userId)
return preview_result
# CLI 示例
if __name__ == "__main__":
#userId = input("请输入用户 ID")
userId = testUid
print(apiGetUserPreview(userId))