Files
astrbot_plugin_linuxdo/_conf_schema.json
RainySY c67b7779ab fix: 修复登录假成功,Cookie 改为每会话注入
根因:linux.do 登录表单启用 hCaptcha 人机验证,自动化浏览器无法通过,
旧自动登录永远不可能成功;而抓取的 _forum_session 是匿名会话本就存在的
cookie,误报「自动登录成功」,导致受限主题一直 404。

修复:
- 移除无效的账号密码自动登录(_auto_login_and_capture)
- Cookie 改为每个 StealthySession 会话都重新注入(旧代码跨请求丢失)
- 登录校验端点改用 /notifications.json(匿名 403 / 登录 200),
  弃用对匿名也返回 404 的 /session/current_user.json
- Cookie 配置支持多格式:完整 Cookie 头、单 name=value、裸值(向后兼容)

linuxdo_username/password 保留仅为兼容,不再生效。
2026-06-16 23:52:59 +08:00

51 lines
2.1 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"cache_ttl": {
"description": "截图缓存有效期(秒)",
"type": "int",
"default": 1800,
"hint": "截图缓存的有效期,默认 1800 秒30 分钟)。设为 0 禁用缓存。"
},
"max_content_length": {
"description": "内容预览最大长度(字符)",
"type": "int",
"default": 400,
"hint": "从页面提取的文字预览最大字符数。"
},
"screenshot_timeout": {
"description": "截图超时时间(秒)",
"type": "int",
"default": 15,
"hint": "等待页面截图的最大秒数。"
},
"screenshot_full_page": {
"description": "全页截图模式",
"type": "bool",
"default": true,
"hint": "默认开启全页截图,关闭后仅截取视口可见区域。"
},
"use_api_render": {
"description": "使用 API + 自定义 HTML 渲染",
"type": "bool",
"default": true,
"hint": "启用后用 Discourse JSON API 拉数据+自定义 HTML 模板渲染(推荐,完整、干净、不受页面截断/懒加载影响);关闭则走传统页面截图方案。"
},
"linuxdo_session_cookie": {
"description": "LinuxDo 会话 Cookie访问受限主题必填",
"type": "string",
"default": "",
"hint": "登录 linux.do → F12 → Application → Cookies → linux.do → 复制 _t推荐长效约 1 年)或 _forum_session短期的 Value 粘贴到这里。也支持完整 Cookie 头格式如『_t=xxx; _forum_session=yyy』。留空则匿名访问无法读取需登录才能看的主题。"
},
"linuxdo_username": {
"description": "LinuxDo 用户名(已弃用)",
"type": "string",
"default": "",
"hint": "⚠️ linux.do 登录启用了 hCaptcha 人机验证,账号密码自动登录已不可用(保留此项仅为兼容)。请改用上方 linuxdo_session_cookie。"
},
"linuxdo_password": {
"description": "LinuxDo 密码(已弃用)",
"type": "string",
"default": "",
"hint": "⚠️ 配合 linuxdo_username 的自动登录已因 hCaptcha 失效。请改用 linuxdo_session_cookie浏览器复制 _t。"
}
}