From 1b1eba53938b861e408f932cf34138c82767a166 Mon Sep 17 00:00:00 2001 From: butubb <1422726308@qq.com> Date: Wed, 24 Sep 2025 08:52:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=9B=9E=E6=89=8B=E5=8A=A8=E6=A3=80?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/main.py b/main.py index 9027790..39804bf 100644 --- a/main.py +++ b/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() @@ -86,11 +70,10 @@ def get_auth_from_browser(): save_auth(captured_headers, captured_cookies) return {"headers": captured_headers, "cookies": captured_cookies} -# -------------------- 获取话题 -------------------- # +# -------------------- 获取话题 -------------------- # def get_topics(headers, cookies): payload = { - "keyword": "", "keytype": 1, "state": -2, "psize": 7, # 因是只处理第一页,这个参数就是操作控制数量 - "tag": 0, "page": 1, + "keyword": "", "keytype": 1, "state": -2, "psize": 7, "tag": 0, "page": 1, "livescene": -1, "typeid": -1, "types": -1, "isOnShelf": -1, "starttime": "", "endtime": "", "chanid": 0, "isHQOut": 0, "isGHHQOut": 0 }