fix(tencent): 登录态校验统一改为 get_auth_info 接口探测(errCode==0),消除测试/发布两套判定不一致;修正登录态 cookie 为 sessionid+wxuin
This commit is contained in:
+4
-15
@@ -41,21 +41,10 @@ async def cookie_auth_douyin(account_file):
|
||||
|
||||
|
||||
async def cookie_auth_tencent(account_file):
|
||||
async with async_playwright() as playwright:
|
||||
browser = await playwright.chromium.launch(headless=LOCAL_CHROME_HEADLESS)
|
||||
context = await browser.new_context(storage_state=account_file)
|
||||
context = await set_init_script(context)
|
||||
# 创建一个新的页面
|
||||
page = await context.new_page()
|
||||
# 访问指定的 URL
|
||||
await page.goto("https://channels.weixin.qq.com/platform/post/create")
|
||||
try:
|
||||
await page.wait_for_selector('div.title-name:has-text("微信小店")', timeout=5000) # 等待5秒
|
||||
tencent_logger.error("[+] 等待5秒 cookie 失效")
|
||||
return False
|
||||
except:
|
||||
tencent_logger.success("[+] cookie 有效")
|
||||
return True
|
||||
# 统一复用 uploader 的 cookie_auth(接口探测优先 + 页面兜底),
|
||||
# 确保「账号测试」与「发布」使用同一套登录态判定口径
|
||||
from uploader.tencent_uploader.main import cookie_auth as _tc_cookie_auth
|
||||
return await _tc_cookie_auth(str(account_file))
|
||||
|
||||
|
||||
async def cookie_auth_ks(account_file):
|
||||
|
||||
Reference in New Issue
Block a user