Repository navigation
Conversation
问题 ---- 添加 Google Cookie 时报错: 添加失败: Google Cookie 验证失败: 'FlowClient' object has no attribute 'get_updated_flow_cookies' 成因 ---- 828b620 把 Cookie 轮换快照方法放进了 FlowFrontendMixin (flow_frontend.py)。当部署方用自定义/旧版 flow_frontend.py 整文件覆盖时, flow_client.py / flow_current.py 里的调用点就会 AttributeError, 整条添加 Cookie 流程直接失败。 修复 ---- 1. 调用点改为安全取值:缺失实现时降级返回原始 Cookie 串, 不改变上游 Cookie 轮换快照的行为(有实现时照旧调用)。 2. _update_flow_cookie_jar 同样做存在性判断,避免流式中断。 3. Google 账号(login_account) 改为可选: - AddTokenRequest / PluginTokenUpdateRequest 允许留空; - 插件同步先用邮箱定位,未提供则按 Cookie 会话(st)反查, 仍未命中则生成与 add_token 一致的占位邮箱 (account-<cookie_hash>@flow.local)。 测试 ---- 新增 tests/test_flow_cookie_snapshot_compat.py 覆盖四种情况: 缺失方法 / 方法存在 / 方法抛错 / None 输入。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
添加 Google Cookie 时失败:
成因
828b620把 Cookie 轮换快照方法放进了FlowFrontendMixin(flow_frontend.py):get_updated_flow_cookies_remember_flow_cookies_update_flow_cookie_jar而
flow_client.py/flow_current.py里已有调用点。部署方如果用自定义/旧版flow_frontend.py整文件覆盖(常见做法:挂载 patched 文件),这些方法会一起消失,调用点直接
AttributeError,整条添加 Cookie 流程失败。修复
getattr+ 降级返回原始 Cookie 串):flow_current.pyst_to_atflow_client.py_build_team_captcha_cookie_mapflow_client.py_update_flow_cookie_jar调用处做存在性判断有实现时行为完全不变,只是不再因覆盖而崩。
AddTokenRequest/PluginTokenUpdateRequest的login_account改为Optional,留空即None;st反查,仍未命中则生成与add_token一致的占位邮箱account-<cookie_hash>@flow.local;测试
新增
tests/test_flow_cookie_snapshot_compat.py:None输入 → 空串