feat: Seedance 视频/音频改用 R2 预签名上传,移除插件内凭证

- 新增 utils/r2_uploader.py:通过 o1key 后端预签名接口上传视频/音频,零 R2 凭证
- seedance_video.py:视频、音频均改为 await upload_video/upload_audio,移除 base64 inline 编码
- 删除 doubao-seedance-2-0-fast 模型选项
- .config 加入 .gitignore,停止 git 追踪,防止 API Key 泄露
- base_client.py:新增系统代理自动检测(Windows 注册表 / macOS networksetup)
This commit is contained in:
Jony
2026-04-21 00:10:55 +08:00
parent c4bb8d9724
commit 07f0c5ed5f
9 changed files with 276 additions and 173 deletions
+10 -2
View File
@@ -577,7 +577,14 @@ class GeminiAPIClient(BaseAPIClient):
download_info = f"{img_size_str}"
# 单行输出
print(f"{task_prefix}请求 {size_str} → API {request_time:.1f}s → {download_info}")
timing = response.get("_timing", {})
net_connect = timing.get("connect_time")
net_download = timing.get("download_time")
if net_connect is not None and net_download is not None:
net_str = f" | 连接 {net_connect:.2f}s | 下载 {net_download:.2f}s"
else:
net_str = ""
print(f"{task_prefix}请求 {size_str} → API {request_time:.1f}s → {download_info}{net_str}")
# 返回结果和计时信息
total_time = time.time() - total_start
@@ -721,7 +728,8 @@ class GeminiAPIClient(BaseAPIClient):
raise first_error
raise RuntimeError(f"批量生成失败,{fail_count} 个请求全部失败")
print(f"GeminiClient: 批量生成完成,成功 {success_count}/{batch_size},失败 {fail_count}")
if batch_size > 1:
print(f"GeminiClient: 批量生成完成,成功 {success_count}/{batch_size},失败 {fail_count}")
return all_images
def generate_sync(