AuthLite PowerOn初步实现和其他改进
This commit is contained in:
@@ -5,6 +5,7 @@ from API_TitleServer import apiSDGB
|
||||
from Config import *
|
||||
import time
|
||||
import random
|
||||
from loguru import logger
|
||||
|
||||
def apiGetUserPreview(userId, noLog:bool=False) -> str:
|
||||
data = json.dumps({
|
||||
@@ -26,7 +27,7 @@ if __name__ == "__main__":
|
||||
def crawlAllUserPreview():
|
||||
"""omg it's a evil crawler"""
|
||||
# 这里设置开始和结束的 UserId
|
||||
BeginUserId = 11000000
|
||||
BeginUserId = 10200000
|
||||
EndUserId = 12599999
|
||||
|
||||
# 打开文件,准备写入
|
||||
@@ -35,11 +36,12 @@ def crawlAllUserPreview():
|
||||
for userId in range(BeginUserId, EndUserId + 1):
|
||||
# 调用 API
|
||||
try:
|
||||
userPreview = apiGetUserPreview(userId)
|
||||
userPreview = apiGetUserPreview(userId, True)
|
||||
currentUser = json.loads(userPreview)
|
||||
if currentUser["userId"] is not None:
|
||||
# 每爬到一个就把它存到一个文件里面,每个一行
|
||||
f.write(userPreview + "\n")
|
||||
logger.info(f"{userId}: {currentUser['userName']}, RATING: {currentUser['playerRating']}")
|
||||
else:
|
||||
f.write("\n")
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user