@q253595422/dsh-imagegen-video 1.15.1 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/docs/releases/v1.15.2.md +29 -0
- package/lib/client.js +1576 -413
- package/lib/client.js.map +1 -1
- package/lib/index.js +32 -8
- package/lib/locale-tables-chunk.js +123 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ Attribution for third-party code is in [NOTICE](./NOTICE).
|
|
|
5
5
|
|
|
6
6
|
## Releases
|
|
7
7
|
|
|
8
|
+
### 1.15.2 — 视频取片支持 `/content` 回退
|
|
9
|
+
|
|
10
|
+
- **A finished task with no URL in its body is now downloaded instead of
|
|
11
|
+
failed (#9).** OpenAI's video API — and the OpenAI-compatible relays that
|
|
12
|
+
copy it — report `status: "completed"` with no `url` anywhere and serve the
|
|
13
|
+
bytes only from `GET /videos/{id}/content`. `readPoll()` treated that body as
|
|
14
|
+
"completed but no video address" and failed a render the provider had already
|
|
15
|
+
finished. The poll now reports the content endpoint as the clip source, and
|
|
16
|
+
the download leg fetches it unchanged — same-origin key forwarding, MIME
|
|
17
|
+
inference and the size cap all still apply. A body URL is still preferred,
|
|
18
|
+
and a `/content` that 404s reports the download leg rather than passing as a
|
|
19
|
+
silent success.
|
|
20
|
+
|
|
8
21
|
### 1.15.1 — 火山适配的收口修复
|
|
9
22
|
|
|
10
23
|
- **Ark pixel sizes stay inside the budget.** At 4K / 16:9 the solved
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# v1.15.2 — 视频取片支持 `/content` 回退
|
|
2
|
+
|
|
3
|
+
一句话概括:任务已经渲染完成、轮询却因为没有 URL 被判失败的情况,现在会真的把成片取回来。
|
|
4
|
+
|
|
5
|
+
## 为什么
|
|
6
|
+
|
|
7
|
+
`readPoll()` 只在轮询响应体的六个字段里找视频地址,找不到就把任务判成失败,弹出「视频任务已完成但未返回视频地址」。
|
|
8
|
+
|
|
9
|
+
但 OpenAI 官方的视频 API——以及照抄它的 OpenAI 兼容网关——在终态里**不返回任何 URL**:`status` 走到 `completed`,成片只通过 `GET /v1/videos/{id}/content` 以二进制流提供。于是上游明明渲染好了,插件这边报失败,用户拿不到片子;对按次计费的上游来说,这次调用是白花的。
|
|
10
|
+
|
|
11
|
+
这不是某一个网关的私有行为,所以修在上游协议这一层,而不是给某个渠道加特判。
|
|
12
|
+
|
|
13
|
+
## 做了什么
|
|
14
|
+
|
|
15
|
+
- **轮询结果能表达两种取片来源**:响应体里有 URL 就照旧用 URL(优先级不变,它通常指向 CDN,比回源更省事);没有任何 URL 但状态已完成时,轮询把 `/content` 端点作为片源返回,而不是判失败。
|
|
16
|
+
- **下载沿用同一条腿**:`/content` 的字节走原有的下载函数,同源鉴权转发、MIME 推断、体积上限全部照旧生效——没有为它新开一条绕过这些约束的通道。
|
|
17
|
+
- **失败仍然是失败**:`/content` 返回 404 之类的错误时,报的是下载环节的真实错误,不会静默当作成功。任务真失败(`failed` / `expired`)的判定也完全没变。
|
|
18
|
+
|
|
19
|
+
## 验证
|
|
20
|
+
|
|
21
|
+
- `scripts/smoke-video.mjs` 新增两条用例:一条让 mock 上游只给 `/content`、响应体不含 URL,断言成片被取回;一条让 `/content` 返回 404,断言报出的是下载错误而不是「已完成但无地址」。
|
|
22
|
+
- `scripts/verify-negative.mjs` 加了对应的缺陷注入:把回退移除后,新用例会变红,确认这两条测试确实在看这件事。
|
|
23
|
+
- `node scripts/smoke-video.mjs` 全绿。
|
|
24
|
+
|
|
25
|
+
## 影响面
|
|
26
|
+
|
|
27
|
+
只影响「轮询响应体里没有视频地址」的分支;有 URL 的渠道走的是原来那条路径,行为不变。
|
|
28
|
+
|
|
29
|
+
Closes #9.
|