{"record":{"id":"b0c5c765c1302117","repo":"jackwener/OpenCLI","slug":"error-b0c5c7","errorCode":null,"errorMessage":"内容安全检测不通过，请修改后重试","messagePattern":"内容安全检测不通过，请修改后重试","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/douyin/publish.js","lineNumber":235,"sourceCode":"            let pollUnavailableCount = 0;\n            while (Date.now() < deadline) {\n                const poll = await tryFastDetectFetch(page, 'POST', pollUrl, { body: safetyBody });\n                if (!poll.ok) {\n                    pollUnavailableCount += 1;\n                    if (!preCheck.ok && pollUnavailableCount >= 3) {\n                        break;\n                    }\n                    await sleep(2000);\n                    continue;\n                }\n                pollUnavailableCount = 0;\n                const pollRes = poll.value;\n                if (pollRes.status === 0 || (pollRes.has_done === true && pollRes.detect_result?.reason_code === 0 && (pollRes.detect_list?.length ?? 0) === 0)) {\n                    safetyPassed = true;\n                    break;\n                }\n                if (pollRes.status === 1) {\n                    throw new CommandExecutionError('内容安全检测不通过，请修改后重试', '使用 --no_safety_check 跳过');\n                }\n                await sleep(2000);\n            }\n            if (!safetyPassed) {\n                if (!preCheck.ok && pollUnavailableCount >= 3) {\n                    process.stderr.write('  内容安全预检持续无响应，跳过本地预检，交由 create_v2 后的平台审核。\\n');\n                }\n                else {\n                    throw new CommandExecutionError('内容安全检测超时（30s），请稍后重试', '如确认要跳过本地预检，可使用 --no_safety_check；提交后仍会走抖音平台审核');\n                }\n            }\n        }\n        // ── Phase 8: create_v2 publish ──────────────────────────────────────\n        const hashtagNames = extractHashtagNames(caption);\n        const hashtags = [];\n        let searchFrom = 0;\n        for (const name of hashtagNames) {\n            const idx = caption.indexOf(`#${name}`, searchFrom);","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/douyin/publish.js#L217-L253","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Revise the title/caption to remove flagged or sensitive wording, then republish","Rerun with --no_safety_check to skip the local pre-check (Douyin's own review still runs and may reject the post)","Break the caption into more neutral phrasing, avoiding URLs, contact details, and promotional claims","Check platform content policy for the specific category your video falls under"],"exampleFix":"// before\nawait douyin.publish({ title: '限时免费加微信领取', caption: longAdCopy });\n// after\nawait douyin.publish({ title: '新品上手评测', caption: sanitizedCopy });","handlingStrategy":"fallback","validationCode":"function captionLooksRisky(text) {\n  const risky = [/微信/i, /加我/i, /(https?:\\/\\/)/, /免费领/i, /代购/i];\n  return risky.some((re) => re.test(text));\n}\nif (captionLooksRisky(caption)) caption = sanitize(caption);","typeGuard":"function isSafeText(s) {\n  return typeof s === 'string' && !/(微信|加我|http|免费领)/.test(s);\n}","tryCatchPattern":"try {\n  await douyin.publish({ title, caption });\n} catch (e) {\n  if (e instanceof CommandExecutionError && /内容安全检测不通过/.test(e.message)) {\n    // Either revise the copy or intentionally bypass:\n    await douyin.publish({ title, caption, no_safety_check: true });\n  } else throw e;\n}","preventionTips":["Screen titles/captions for banned keywords before publishing","Avoid URLs, contact info, and aggressive promotional phrasing","Keep a sanitized-copy fallback prepared","Remember --no_safety_check only skips the local pre-check; platform review still applies"],"tags":["content-policy","safety-check","validation"],"backgroundTag":"content-moderation-rejected","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}