jackwener/OpenCLI · error · CommandExecutionError

内容安全检测不通过,请修改后重试

Error message

内容安全检测不通过,请修改后重试

What it means

Before publishing, the command polls Douyin's content-safety pre-check endpoint. If the poll reports status === 1, the platform has judged the content as violating policy, and publish.js throws this CommandExecutionError. The hint payload points to --no_safety_check to bypass the local pre-check (platform review still applies afterward).

Source

Thrown at clis/douyin/publish.js:235

            let pollUnavailableCount = 0;
            while (Date.now() < deadline) {
                const poll = await tryFastDetectFetch(page, 'POST', pollUrl, { body: safetyBody });
                if (!poll.ok) {
                    pollUnavailableCount += 1;
                    if (!preCheck.ok && pollUnavailableCount >= 3) {
                        break;
                    }
                    await sleep(2000);
                    continue;
                }
                pollUnavailableCount = 0;
                const pollRes = poll.value;
                if (pollRes.status === 0 || (pollRes.has_done === true && pollRes.detect_result?.reason_code === 0 && (pollRes.detect_list?.length ?? 0) === 0)) {
                    safetyPassed = true;
                    break;
                }
                if (pollRes.status === 1) {
                    throw new CommandExecutionError('内容安全检测不通过,请修改后重试', '使用 --no_safety_check 跳过');
                }
                await sleep(2000);
            }
            if (!safetyPassed) {
                if (!preCheck.ok && pollUnavailableCount >= 3) {
                    process.stderr.write('  内容安全预检持续无响应,跳过本地预检,交由 create_v2 后的平台审核。\n');
                }
                else {
                    throw new CommandExecutionError('内容安全检测超时(30s),请稍后重试', '如确认要跳过本地预检,可使用 --no_safety_check;提交后仍会走抖音平台审核');
                }
            }
        }
        // ── Phase 8: create_v2 publish ──────────────────────────────────────
        const hashtagNames = extractHashtagNames(caption);
        const hashtags = [];
        let searchFrom = 0;
        for (const name of hashtagNames) {
            const idx = caption.indexOf(`#${name}`, searchFrom);

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Revise the title/caption to remove flagged or sensitive wording, then republish
  2. Rerun with --no_safety_check to skip the local pre-check (Douyin's own review still runs and may reject the post)
  3. Break the caption into more neutral phrasing, avoiding URLs, contact details, and promotional claims
  4. Check platform content policy for the specific category your video falls under

Example fix

// before
await douyin.publish({ title: '限时免费加微信领取', caption: longAdCopy });
// after
await douyin.publish({ title: '新品上手评测', caption: sanitizedCopy });
Defensive patterns

Strategy: fallback

Validate before calling

function captionLooksRisky(text) {
  const risky = [/微信/i, /加我/i, /(https?:\/\/)/, /免费领/i, /代购/i];
  return risky.some((re) => re.test(text));
}
if (captionLooksRisky(caption)) caption = sanitize(caption);

Type guard

function isSafeText(s) {
  return typeof s === 'string' && !/(微信|加我|http|免费领)/.test(s);
}

Try / catch

try {
  await douyin.publish({ title, caption });
} catch (e) {
  if (e instanceof CommandExecutionError && /内容安全检测不通过/.test(e.message)) {
    // Either revise the copy or intentionally bypass:
    await douyin.publish({ title, caption, no_safety_check: true });
  } else throw e;
}

Prevention

When it happens

Trigger: The safety poll response returns status: 1 during Phase 7 of publish — i.e., Douyin's content-safety service actively rejects the title/caption/video content being scheduled.

Common situations: Captions or titles containing sensitive/banned keywords, promotional or contact info flagged by the platform, borderline media content; users who previously relied on the content passing, then changed the caption text.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/b0c5c765c1302117. Report an issue: GitHub.