-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
@@ -236,19 +236,8 @@ class Session(requests.Session):
# 自动获取 2FA code
if self._config["auto"]:
- # 不断尝试获取 code.txt 内容,如果为空则等待 1s
- code = ""
- for i in range(30):
- with open("code.txt", "r") as f:
- code = f.read().strip()
- if code:
- break
- print("Waiting for code...")
- time.sleep(1)
- # 删除 code.txt
- with open("code.txt", "w") as f:
- f.write("")
-
+ totp = pyotp.TOTP(self._config["totp"])
+ code = totp.now()
# 手动输入 2FA code
else:
code = input("Please input the 2FA code: ")
:)
Metadata
Metadata
Assignees
Labels
No labels