Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 71885eb194 | |||
| 1b1eba5393 | |||
| 95ed674607 | |||
| 0fe59ff83a | |||
| 295dbf10e7 |
18
main.py
18
main.py
@@ -44,26 +44,10 @@ def get_auth_from_browser():
|
||||
driver.requests.clear()
|
||||
|
||||
driver.get("https://live.vzan.com/admin/index.html")
|
||||
|
||||
log("请在浏览器窗口中手动登录...", "INFO")
|
||||
|
||||
# 自动检测是否登录成功
|
||||
timeout = 120 # 最多等 120 秒
|
||||
start_time = time.time()
|
||||
while True:
|
||||
if "admin/index.html" in driver.current_url:
|
||||
# 登录后会进入后台页面
|
||||
log("检测到已进入后台管理页面,继续获取认证信息", "INFO")
|
||||
break
|
||||
if time.time() - start_time > timeout:
|
||||
driver.quit()
|
||||
raise Exception("登录超时,请检查账号密码或验证码")
|
||||
time.sleep(2)
|
||||
|
||||
input("请手动登录网站,登录完成后按回车继续...")
|
||||
driver.get(ADMIN_URL)
|
||||
log("等待页面加载完成...", "INFO")
|
||||
|
||||
|
||||
# 捕获 headers 和 cookies
|
||||
timeout = 60
|
||||
start_time = time.time()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
altgraph==0.17.4
|
||||
attrs==25.3.0
|
||||
blinker==1.5
|
||||
Brotli==1.1.0
|
||||
@@ -12,12 +13,17 @@ hyperframe==6.1.0
|
||||
idna==3.10
|
||||
kaitaistruct==0.11
|
||||
outcome==1.3.0.post0
|
||||
packaging==25.0
|
||||
pefile==2023.2.7
|
||||
pyasn1==0.6.1
|
||||
pycparser==2.23
|
||||
pydivert==2.1.0
|
||||
pyinstaller==6.16.0
|
||||
pyinstaller-hooks-contrib==2025.8
|
||||
pyOpenSSL==25.3.0
|
||||
pyparsing==3.2.5
|
||||
PySocks==1.7.1
|
||||
pywin32-ctypes==0.2.3
|
||||
requests==2.32.5
|
||||
selenium==4.35.0
|
||||
selenium-wire==5.1.0
|
||||
|
||||
Reference in New Issue
Block a user