Skip to content

Commit 7567b64

Browse files
committed
Update 二维码登录.py (#67)
1 parent 19a7ea4 commit 7567b64

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

demos/二维码登录.py

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def login():
1111
LoginQrcodeUnikey,
1212
LoginQrcodeCheck,
1313
)
14+
from pyncm import GetCurrentSession, DumpSessionAsString, LoadSessionFromString
1415

1516
uuid = LoginQrcodeUnikey()["unikey"] # 获取 UUID
1617
print("UUID", uuid)
@@ -28,6 +29,10 @@ def login():
2829
# 登录成功
2930
print(f"{rsp['code']} -- {rsp['message']}", "...")
3031
WriteLoginInfo(GetCurrentLoginStatus())
32+
print("[!] 登录态 Session:", DumpSessionAsString(GetCurrentSession()))
33+
print(
34+
'[-] 此后可通过 SetCurrentSession(LoadSessionFromString("PYNCMe...")) 恢复当前登录态'
35+
)
3136
return True
3237
time.sleep(1)
3338

0 commit comments

Comments
 (0)