Commit Graph

64 Commits

Author SHA1 Message Date
genz27
cb50ea0a5c feat: 新增验证码分数测试并优化浏览器打码流程
- 后台新增 /api/captcha/score-test,支持按当前打码配置直接测分并返回详细结果
- 管理后台新增当前打码分数测试入口,展示 score、耗时、action、hostname 等信息
- 优化 browser 与 personal 模式的 reCAPTCHA 执行、页面测分、代理兼容与 UA 策略
2026-03-01 07:43:19 +08:00
genz27
e5ef238849 1.修复新模型参考图BUG
2.新增媒体上传下载独立代理
3.打码和请求的代理尽量使用一致的
4.新增代理检测
5.请求日志增加图片展示以及2K4K图片展示,完整响应
等。
2026-02-28 00:06:31 +08:00
genz27
f23cd7ddf6 feat: 新增模型与请求体变化并同步README 2026-02-27 16:11:19 +08:00
genz27
27c62df131 chore: 移除 .lh 缓存目录并添加到 .gitignore
Co-Authored-By: Warp <agent@warp.dev>
2026-02-04 19:05:30 +08:00
genz27
260483d137 refactor: 将有头浏览器打码从 patchright 改为 playwright
- browser_captcha.py: 所有 patchright 引用改为 playwright
- flow_client.py: 更新错误提示信息
- requirements.txt: patchright 改为 playwright

Co-Authored-By: Warp <agent@warp.dev>
2026-02-04 18:54:52 +08:00
genz27
5817830c34 feat: 添加浏览器打码依赖自动安装和Docker环境检测
Co-Authored-By: Warp <agent@warp.dev>
2026-02-04 18:46:24 +08:00
genz27
8358864acd feat: 添加浏览器打码依赖自动安装和Docker环境检测
- browser_captcha.py: 添加patchright和chromium自动安装(官方源优先,国内镜像备用)
- browser_captcha_personal.py: 添加nodriver自动安装(官方源优先,国内镜像备用)
- 两个模块都添加Docker环境检测,Docker中禁用本地浏览器打码
- flow_client.py: 更新错误处理,提供更清晰的安装指引
- .gitignore: 添加browser_data_rt目录

Co-Authored-By: Warp <agent@warp.dev>
2026-02-04 18:44:30 +08:00
Genz
b633567702 Merge pull request #57 from Zluo003/patch-1
Update URL for batch async video upsampling
2026-02-04 00:05:44 +08:00
Genz
f444c6e17f Merge pull request #60 from CrewS/fix/i2v-single-frame-model-key
fix: 修复单帧图生视频 model_key 转换逻辑
2026-02-04 00:01:28 +08:00
crews
a570ba79ce fix: 修复单帧图生视频 model_key 转换逻辑
修复 I2V 单帧模式下 _fl 后缀去除失败的问题。

原逻辑仅处理 _fl_ 在中间的情况,但实际模型名称 _fl 在结尾:
- veo_3_1_i2v_s_fast_ultra_fl 应转为 veo_3_1_i2v_s_fast_ultra

现在同时处理两种情况:
1. _fl_ 在中间: replace("_fl_", "_")
2. _fl 在结尾: endswith("_fl") 后截取

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 17:53:01 +08:00
Zluo003
56f75f1a39 Update URL for batch async video upsampling 2026-01-28 20:55:15 +08:00
TheSmallHanCat
6e0803d76c feat: 添加插件自动启用配置字段 2026-01-28 17:00:51 +08:00
genz27
0f621e02f5 Merge branch 'main' of https://github.com/TheSmallHanCat/flow2api 2026-01-28 00:38:23 +08:00
genz27
749a76403c fix: 修复打码配置热加载和模型转换问题
- 修复热加载缺少 ezcaptcha/capmonster/capsolver 配置同步

- EZ-Captcha 改用 ReCaptchaV3TaskProxylessS9 高分值版本

- 获取不到 reCAPTCHA token 时直接返回错误

- 修复 TIER_TWO portrait 模型名称转换错误

Co-Authored-By: Warp <agent@warp.dev>
2026-01-28 00:37:19 +08:00
Genz
80ee8d7566 Update docker-compose.yml 2026-01-27 23:55:58 +08:00
genz27
deb4314605 fix: 统一视频模型命名为官方格式
- 修正 model_id (字典 key) 和 model_key 为统一的官方命名
- 竖屏 ultra: portrait 在 ultra 之前 (如 veo_3_1_t2v_fast_portrait_ultra)
- 横屏 ultra: 没有 landscape 后缀 (如 veo_3_1_t2v_fast_ultra)
- 适用于所有 T2V、I2V、R2V 模型及其 4K/1080P 放大版本

Co-Authored-By: Warp <agent@warp.dev>
2026-01-27 20:54:32 +08:00
genz27
c42cf8e33b fix: 修复各个代码文件中对action参数的调用
- 将FLOW_GENERATION替换为IMAGE_GENERATION/VIDEO_GENERATION
- browser_captcha_personal.py: get_token/execute方法支持action参数
- flow_client.py: _get_api_captcha_token支持动态action
- 更新数据库和模型的默认值
- 添加GitHub Actions工作流用于构建ghcr.io镜像

Co-Authored-By: Warp <agent@warp.dev>
2026-01-27 18:44:46 +08:00
genz27
f2d92d1caf fix: 修复 Windows 上 patchright asyncio 兼容性问题
自动设置 PLAYWRIGHT_BROWSERS_PATH 环境变量,用户无需额外配置

Co-Authored-By: Warp <agent@warp.dev>
2026-01-27 13:11:10 +08:00
genz27
97a2ac327e refactor: replace playwright with patchright for better anti-detection
- Switch from playwright to patchright (anti-detection fork)
- Keeps all existing UA pool and route interception logic
- Better bypass for reCAPTCHA detection

Co-Authored-By: Warp <agent@warp.dev>
2026-01-27 12:51:17 +08:00
genz27
a727623a7d fix: 图片放大改用 IMAGE_GENERATION action
Co-Authored-By: Warp <agent@warp.dev>
2026-01-27 12:44:55 +08:00
genz27
0c95869901 feat: 改进4K放大重试逻辑和日志大字段截断
- 4K放大失败时使用通用重试逻辑,支持403、reCAPTCHA、超时等多种错误类型
- 日志记录时对 encodedImage 等大字段进行截断处理,避免4K base64数据撑爆日志

Co-Authored-By: Warp <agent@warp.dev>
2026-01-26 20:42:02 +08:00
genz27
4171d1034e 修复保存浏览器数量列browser_count缺失报错
Co-Authored-By: Warp <agent@warp.dev>
2026-01-26 20:04:48 +08:00
genz27
99bedf863f 更新:1.本地打码方式修改为有头并增加并行(可设置启动浏览器数量)2.修复flow视频和图片请求体报错400 3.新增图片和视频画质提升包括4K,2K以及1080p等 4.调整管理员端配置UI布局
Co-Authored-By: Warp <agent@warp.dev>
2026-01-26 14:15:12 +08:00
TheSmallHanCat
aec69d2feb Merge branch 'main' of https://github.com/TheSmallHanCat/flow2api 2026-01-18 12:42:37 +08:00
TheSmallHanCat
49d8e1d68d feat: 支持更多打码平台 2026-01-18 12:41:38 +08:00
TheSmallHanCat
ad17d67097 Merge pull request #39 from NetLops/sz
WIP
2026-01-17 10:44:28 +08:00
Netlops
92006a0d37 feat(api): support remote image URL downloading in chat completion
- Extract image from URL or base64 instead of base64 only
- Add support for downloading remote image URLs starting with http/https
- Implement error handling for image download failures
- Add debug logging for image processing steps

fix(config): update model keys for veo_3_0 video generation

- Update veo_3_0_r2v_fast_portrait model key to
  veo_3_0_r2v_fast_portrait_ultra_relaxed
- Update veo_3_0_r2v_fast_landscape model key to
  veo_3_0_r2v_fast_ultra_relaxed
2026-01-16 17:35:56 +08:00
TheSmallHanCat
8ef7ac7e2e Merge pull request #37 from yibaiba/main
优化ultra用户生成视频与不同的账号使用不同的 ua
2026-01-14 19:44:37 +08:00
yibaiba
efae66114c 优化ultra用户生成视频与不同的账号使用不同的 ua 2026-01-14 19:15:48 +08:00
Netlops
063e810d8b feat(token): add automatic ST refresh functionality for personal mode
- Implement automatic ST (Session Token) refresh when AT refresh fails
- Add refresh_session_token method in BrowserCaptchaService to extract
  __Secure-next-auth.session-token from browser cookies
- Enhance token_manager to automatically retry AT refresh after ST update
- Add validation for AT tokens to ensure they are actually working
- Update README to document AT/ST automatic refresh feature
- Improve error handling and logging for token refresh operations
- Add conditional ST refresh support only available in personal mode
2026-01-08 12:32:48 +08:00
Netlops
91dcd8fd85 feat(i2v): enhance image-to-video documentation and single/dual frame support
- Update README.md to clarify single vs dual frame image support with
  automatic model_key selection
- Add detailed explanation of automatic adaptation system for
  different image counts
- Include clear distinction between single frame mode (1 image) and
  dual frame mode (2 images) with proper model selection

fix(browser-captcha): increase page load timeout from 15s to 60s

- Extend retry range from 15 to 60 attempts for page loading
- Update debug logging to reflect new timeout values
- Improve reliability of captcha service by allowing more time for
  page load completion

fix(api): correct I2V API endpoint URL for single frame generation

- Change URL from batchAsyncGenerateVideoStartAndEndImage to
  batchAsyncGenerateVideoStartImage for single frame scenarios

fix(model-config): correct model_key for I2V single frame mode

- Fix typo in model_key: remove duplicate 'fl_' in
  veo_3_1_i2v_s_fast_fl_landscape
- Implement automatic model_key transformation for single frame mode
  by replacing '_fl_' with '_' in model keys
- Add debug logging for model key transformation process
2026-01-08 11:45:24 +08:00
TheSmallHanCat
7fc098ba31 feat: 普通账号支持使用banana pro模型 2026-01-04 17:22:51 +08:00
TheSmallHanCat
199b46576c feat: 完善图片生成连续对话功能 2026-01-04 17:22:32 +08:00
TheSmallHanCat
d96fe18fa5 feat: 浏览器拓展更新st自动启用token、新增ultra模型、完善日志记录显示 2026-01-04 17:22:19 +08:00
Netlops
9291512bd2 feat(browser-captcha): support multi-project resident tabs for reCAPTCHA
- Add ResidentTabInfo class to manage per-project resident tab information
- Replace single resident tab with dictionary mapping project_id to tab info
- Implement automatic resident tab creation for each project_id on demand
- Add thread-safe lock protection for resident tab operations
- Update stop_resident_mode to support closing specific project tabs
- Add _create_resident_tab method for project-specific tab creation
- Add _close_resident_tab method for proper tab cleanup
- Maintain backward compatibility with existing single resident mode properties
- Update status query methods to support multiple resident tabs
- Clear resident tabs dictionary when browser closes
2025-12-30 19:52:01 +08:00
Netlops
6d28e78a13 feat(generation): handle media generation failure status
- Add specific handling for MEDIA_GENERATION_STATUS_FAILED status
- Extract error code and message from operation response
- Update database task status to failed with error details
- Provide user-friendly error messages with retry suggestions
- Add streaming support for error messages in real-time
- Improve error handling for various failure scenarios
2025-12-30 17:30:51 +08:00
Netlops
2f3b0a4f33 feat(browser-captcha): add resident mode for persistent reCAPTCHA token generation
- Implement resident mode that maintains a persistent tab for instant token generation
- Add automatic project ID detection from active tokens during initialization
- Support fallback to traditional mode when no active project ID is available
- Add proper sandbox configuration and profile directory handling for nodriver
- Implement reCAPTCHA loading with retry mechanism and error handling
- Add legacy mode as fallback when resident mode fails
- Include comprehensive logging for both resident and legacy modes
- Add browser state management and cleanup functions
2025-12-30 17:09:57 +08:00
Netlops
747d0cd2e7 feat(browser): replace playwright with nodriver for captcha service
- Add nodriver dependency for advanced browser automation
- Replace BrowserCaptchaService implementation with nodriver-based solution
- Remove headless environment detection logic as nodriver handles this natively
- Update browser captcha service to use undetected-chromedriver successor
- Maintain persistent browser profiles for login state preservation

fix(models): update video model keys for portrait and landscape variants

- Change veo_3_1_i2v_s_fast_fl to veo_3_1_i2v_s_fast_portrait_fl_ultra_relaxed
- Change veo_3_1_i2v_s_fast_fl to veo_3_1_i2v_s_fast_landscape_fl_ultra_relaxed
- Ensure proper aspect ratio configuration for video generation models
2025-12-30 15:35:05 +08:00
Netlops
c21f7708a6 feat: add auto-detection for headless environments and auto-switch captcha modes
- Add helper function to detect headless/Docker environments in main.py
- Implement auto-downgrade from personal to browser captcha mode in headless environments
- Show warning messages when switching modes automatically
- Update FlowClient to accept database instance for captcha configuration

config: update default server port and enable proxy by default

- Change default server port from 8000 to 18282 in config/setting.toml
- Enable proxy by default with localhost:7897 URL
- Update Docker and docker-compose configurations to use port 38000 for API

build: add China mirror sources for faster dependency installation

- Configure Debian apt to use Tsinghua University mirrors
- Set PyPI to use Tsinghua University index with trusted host
- Configure Playwright to download from npmmirror for faster installation

chore: update gitignore to exclude data and config files

- Add data directory to .gitignore
- Exclude config/setting.toml and config/setting_warp.toml from version control

docs: update docker-compose configurations for new port mappings

- Change exposed port from 8000 to 38000 in docker-compose.yml
- Update proxy service port from 1080 to 31080 in docker-compose.proxy.yml
- Ensure proper volume mapping for Cloudflare WARP data persistence
2025-12-30 14:00:30 +08:00
TheSmallHanCat
35d960d238 fix: 文件缓存
feat: 自动更新st接口
2025-12-25 18:21:17 +08:00
TheSmallHanCat
4bb28f5304 Merge pull request #21 from DAntyNoel/personal
无头浏览器仍然403的替代方案
2025-12-18 17:28:48 +08:00
dantynoel
7d10a661ba feat: align with main branch 2025-12-18 16:56:48 +08:00
dantynoel
3cb9e0405c fork: 个人用途可以在内置浏览器上登录对应的谷歌账号,测试可行 2025-12-18 16:43:50 +08:00
TheSmallHanCat
89cede985f feat: 为无头模式设置独立代理 2025-12-17 20:40:06 +08:00
TheSmallHanCat
a1b73579fd feat: 为无头模式设置独立代理 2025-12-17 20:35:00 +08:00
TheSmallHanCat
f63c37f841 fix: 无头模式下代理不生效 2025-12-17 20:07:44 +08:00
TheSmallHanCat
a374db7452 fix: docker构建 2025-12-17 19:06:15 +08:00
TheSmallHanCat
d4d60467ea feat: 前端无头配置 2025-12-17 19:03:56 +08:00
TheSmallHanCat
de31fe0877 feat: 无头打码与YesCaptcha打码 2025-12-17 18:51:10 +08:00
TheSmallHanCat
ea88387d4c fix: token导入 2025-12-17 17:32:15 +08:00