Skip to content

Feature: Distributed Captcha Extension, VEO Video Extend & Timeout Optimization#133

Merged
genz27 merged 5 commits intoTheSmallHanCat:mainfrom
aicrossai:main
Apr 30, 2026
Merged

Feature: Distributed Captcha Extension, VEO Video Extend & Timeout Optimization#133
genz27 merged 5 commits intoTheSmallHanCat:mainfrom
aicrossai:main

Conversation

@aicrossai
Copy link
Copy Markdown
Contributor

Summary

add Flow2API Captcha Worker extension support to bypass Google reCAPTCHA Enterprise v3 via real browser injection
support distributed extension nodes: extensions can run on different ports/machines and map to specific backend accounts using unique route_key
temporary Labs tabs are auto-opened and closed for each request to prevent token expiration
add complete video extend logic and automatic concatenation for VEO models
add 4-minute timeout to MEDIA_GENERATION_STATUS_ACTIVE to prevent infinite polling bugs
auto-downgrade models for TIER_ONE accounts to prevent permission errors
Details

  1. 自研 Flow2API Captcha Worker 分布式浏览器插件:

动态防过期:在后端请求 Token 时,插件会自动在后台瞬间静默打开 labs.google 标签页,执行 grecaptcha.enterprise 获取真实的 reCAPTCHA Enterprise Token 后立刻销毁标签页,从根本上解决 Token 获取失败和提前过期问题。
分布式多节点路由 (route_key):突破了单机环境限制,在 WebSocket 握手时支持根据 route_key 分发任务。这意味着你可以开无数个不同端口的Chrome浏览器实例,后端能精准把特定账号的打码任务路由给它对应的真实浏览器插件!亲测有效,很稳定
2. 完整的视频续写 (Extend) 与无缝拼接逻辑:
新增了对 extend 视频类型的处理逻辑,支持解析传入的源视频 mediaGenerationId。
调用上游的 generate_video_extend 接口完成 8s 视频续写。
自动无缝拼接:在续写完成后,自动调用拼接接口 (run_concatenation),将原视频与续写片段合并,最终直接向用户返回拼接好的 16s 完整视频链接。
3. 上游生成卡死 (ACTIVE 状态) 的自动熔断机制:
修复了当上游任务进度长时间卡在 45%(MEDIA_GENERATION_STATUS_ACTIVE)时会导致无限轮询的 Bug。
新增了超时阻断:如果在 ACTIVE 状态停留超过 4 分钟(约 80 次轮询),会自动中断并抛出超时失败,防止服务器的并发队列和资源被无效占用。
4. 账号 Tier (等级) 的模型自动适配:
根据 PAYGATE_TIER_ONE 和 TIER_TWO,自动做模型的升降级处理。比如 TIER_ONE 用户误传 ultra 模型时会自动降级到标准版,避免因账号权限不足导致请求直接报错。

Copy link
Copy Markdown
Collaborator

@genz27 genz27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理与最新 main 的冲突,并按 PR 侧优先保留功能;补齐合并后的启动/类型/数据库字段问题,收窄扩展权限并清理调试产物。本地验证:compileall、import smoke test、pytest -q 均通过(14 passed)。

@genz27 genz27 merged commit da2ad06 into TheSmallHanCat:main Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants