AuthLite实现,ApiHash草稿,各种小改进
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import rapidjson as json
|
||||
import time
|
||||
from loguru import logger
|
||||
import random
|
||||
|
||||
from Config import *
|
||||
from API_TitleServer import apiSDGB
|
||||
@@ -41,12 +42,19 @@ def apiLogout(timestamp:int, userId:int, noLog:bool=False) -> dict:
|
||||
logger.info("登出:结果:"+ str(logout_result))
|
||||
return logout_result
|
||||
|
||||
def generateTimestamp() -> int:
|
||||
def generateTimestampLegacy() -> int:
|
||||
"""生成一个凑合用的时间戳"""
|
||||
timestamp = int(time.time()) - 60
|
||||
logger.info(f"生成时间戳: {timestamp}")
|
||||
return timestamp
|
||||
|
||||
def generateTimestamp() -> int:
|
||||
"""生成一个今天早上 10:00 随机偏移的时间戳"""
|
||||
timestamp = int(time.mktime(time.strptime(time.strftime("%Y-%m-%d 10:00:00"), "%Y-%m-%d %H:%M:%S"))) + random.randint(-600, 600)
|
||||
logger.info(f"生成时间戳: {timestamp}")
|
||||
logger.info(f"此时间戳对应的时间为: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(timestamp))}")
|
||||
return timestamp
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("强制登出 CLI")
|
||||
uid = testUid
|
||||
|
||||
Reference in New Issue
Block a user