mirror of
https://github.com/LibraHp/GetQzonehistory.git
synced 2025-02-22 13:19:07 +00:00
添加工具类
This commit is contained in:
parent
5cff617858
commit
fc9f5f1369
@ -16,14 +16,24 @@ def save_user(cookies):
|
||||
def read_files_in_folder():
|
||||
# 获取文件夹下的所有文件
|
||||
files = os.listdir(user_path)
|
||||
|
||||
# 如果文件夹为空
|
||||
if not files:
|
||||
return None
|
||||
# 输出文件列表
|
||||
print("已保存用户:")
|
||||
print("已登录用户列表:")
|
||||
for i, file in enumerate(files):
|
||||
print(f"{i + 1}. {file}")
|
||||
|
||||
# 选择文件
|
||||
choice = int(input("请选择要登陆的用户: "))
|
||||
while True:
|
||||
try:
|
||||
choice = int(input("请选择要登录的用户序号: "))
|
||||
if 1 <= choice <= len(files):
|
||||
break
|
||||
else:
|
||||
print("无效的选择,请重新输入。")
|
||||
except ValueError:
|
||||
print("无效的选择,请重新输入。")
|
||||
|
||||
# 读取选择的文件
|
||||
selected_file = files[choice - 1]
|
||||
|
@ -50,8 +50,9 @@ def QR():
|
||||
|
||||
|
||||
def cookie():
|
||||
if Config.read_files_in_folder():
|
||||
return eval(Config.read_files_in_folder())
|
||||
select_user = Config.read_files_in_folder()
|
||||
if select_user:
|
||||
return eval(select_user)
|
||||
# 获取 QQ空间 cookie
|
||||
qrsig = QR()
|
||||
ptqrtoken = ptqrToken(qrsig)
|
||||
|
Loading…
Reference in New Issue
Block a user