Repository navigation
feat(ks): 快手发布支持禁下载参数(CLI --no-download / HTTP·MCP noDownload / GUI 勾选) - #70
Merged
Merged
Conversation
added 2 commits
November 7, 2026 01:50
快手发布页「允许下载此作品」默认勾选,作品可被直接下载搬运。需要「宁可不发, 不可发出可下载的作品」这一红线时,原先只能靠人工在页面点掉,无法参数化与复现。 - ks.js: 新增 ensureKsDownloadDisabled —— 按文字定位「允许下载此作品」复选框 (替代 nth-of-type 盲点,避免误伤「允许跟拍/同城展示」),取消勾选后回读终态; 未找到复选框或终态 checked !== false 一律抛错中止发布,不静默放行 - parsePublishArgs: 新增 --no-download(默认 false,其它平台忽略),body 侧支持 noDownload / no-download 并纳入共享字段,help 补充说明 - publishVideo / scheduledPublish: data.noDownload 全链路透传,定时任务触发时 从登记记录的 noDownload 字段回传(漏传=到点默认允许下载) - LocalVideoPublish.vue: 发布弹窗新增「禁止下载此作品」勾选(标注仅快手生效), 首发与重发共用,登记记录 noDownload 回环预填 - videoManager: 重发预填 sample.noDownload - mcp publish.ts: publish_video 增加 noDownload 参数 - 新增 scripts/test-ks-no-download.js(yarn test:ks-no-download)锁住 CLI/HTTP/ 多平台共享字段/help 的解析面 调用位置在自定义封面之后、点击「发布/取消」之前:中止时作品尚未发出,属安全态。
Collaborator
Author
|
请 review。 范围:快手禁下载参数化(主进程自动化 + CLI/HTTP 解析 + GUI 弹窗 + MCP schema),默认不传该参数时行为与现网完全一致。 建议重点看三处:
验证: 已知取舍:① GUI 勾选框放在发布弹窗全局表单(文案注明"仅快手生效"),没有按平台动态显隐——如果更希望只在勾选了快手时才出现,我可以按平台树选中态加 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
快手发布页的「允许下载此作品」默认勾选,发布出去的作品可被直接下载搬运。需要「宁可不发,不可发出可下载的作品」时,目前只能人工在页面上点掉,无法参数化、无法在 CLI/MCP 调用里复现,也无法在批量/定时场景保证。
(本仓库此前没有该参数;这是首次提交到上游。)
方案
按「文字定位 + 取消勾选 + 终态回读」实现,失败即中止发布:
src/main/services/upLoad/ks.js:新增ensureKsDownloadDisabled(page)——遍历.ant-checkbox-group > label,按文本精确匹配「允许下载此作品」(替代nth-of-type盲点,避免误伤「允许跟拍/同城展示」等同组选项),点击取消后 600ms 回读checked。checked !== false→ 抛错。src/main/cli/parsePublishArgs.js:新增--no-download(默认 false,其它平台忽略),HTTP body 支持noDownload/no-download并纳入共享字段(多平台请求会透传到每个目标),help 增补说明。publishVideo.js/scheduledPublish.js:data.noDownload全链路透传;定时任务触发时从登记记录record.noDownload回传(漏传会让到点发布默认允许下载)。LocalVideoPublish.vue发布弹窗新增「禁止下载此作品」勾选(文案标注仅快手生效),首发与重发共用,登记记录noDownload回环预填;videoManager重发时预填sample.noDownload。publish_video增加noDownload参数并映射为--no-download。验证
scripts/test-ks-no-download.js(yarn test:ks-no-download):CLI 缺省 false /--no-download置 true、publishBodyToArgv两种写法、parsePublishRequest单平台、parseMultiPublishRequest多平台共享字段透传、help 文案。全部通过。yarn test:publish-draft-args、yarn test:ks-description、yarn test:data-stats均通过。yarn build:dir通过。[ks] 允许下载此作品: {"found":true,"checkedBefore":true} → 终态 checked=false,作品侧核对为不可下载。行为与风险
noDownload === true生效;不传该参数时行为与现在完全一致,其它平台完全忽略。--draft)同样执行校验,便于干跑阶段就能发现平台改版。.ant-checkbox-group或改名,会以「未找到「允许下载此作品」复选框」失败——需要维护者按新 DOM 更新选择器;这是刻意的失败面,避免静默降级。