fix(worker): download_asset支持HTTP URL下载,兼容预签名file_url #487
Reference in New Issue
Block a user
Delete Branch "fix/download-asset-http-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
存量数据
file_url存的是完整预签名 URL(https:// 开头),#485 fallback 到 file_url 后,download_asset仍然走 oss2 SDK,把完整 URL 当 OSS key 传,下载到的是 XML 错误页。修复
oss_helpers.download_asset自动识别输入类型:http(s)://开头 → 走requests.getHTTP 下载(支持预签名 URL)HTTP 下载使用流式 + 8MB 分片 + 300s 超时,避免大文件内存溢出。
影响范围
只改了
apps/worker/video_processing/oss_helpers.py的download_asset函数,所有调用方(render_adapter主链路+BGM、legacy路径、generation.py BGM)自动受益。测试
tests/unit/test_oss_helpers_download.py,10个测试覆盖:CI全绿,自动审批通过。
CI全绿,自动审批通过。