jackwener/OpenCLI · error · CommandExecutionError

等待抖音封面处理完成超时

Error message

等待抖音封面处理完成超时

What it means

waitForCoverReady polls the quick-check panel up to 20 times (0.5s apart) waiting for Douyin's cover detection to first show '检测中' (busy) and then land on a ready state ('重新检测' or '横/竖双封面缺失'). If that busy→ready transition is not observed within ~10 seconds it throws this CommandExecutionError with the last panel text as detail.

Source

Thrown at clis/douyin/draft.js:210

 */
async function waitForCoverReady(page) {
    let lastPanelText = '';
    let sawBusy = false;
    for (let attempt = 0; attempt < COVER_READY_WAIT_ATTEMPTS; attempt += 1) {
        const panelText = await getCoverCheckPanelText(page);
        const busy = panelText.includes('检测中');
        const ready = (panelText.includes('重新检测')
            || panelText.includes('横/竖双封面缺失'));
        if (busy) {
            sawBusy = true;
        }
        if (sawBusy && ready && !busy) {
            return;
        }
        lastPanelText = panelText;
        await page.wait({ time: 0.5 });
    }
    throw new CommandExecutionError('等待抖音封面处理完成超时', lastPanelText || 'unknown');
}
/**
 * Click the draft button on the composer page and extract the current creation id.
 */
async function clickSaveDraft(page) {
    const result = (await page.evaluate(`() => {
    const extractCreationId = () => {
      const titleInput = Array.from(document.querySelectorAll('input')).find(
        (el) => (el.placeholder || '').includes('填写作品标题')
      );
      if (!(titleInput instanceof HTMLInputElement)) return '';

      const fiberKey = Object.keys(titleInput).find((key) => key.startsWith('__reactFiber$'));
      let fiber = fiberKey ? titleInput[fiberKey] : null;
      while (fiber) {
        const props = fiber.memoizedProps;
        if (typeof props?.creation_id === 'string' && props.creation_id) {
          return props.creation_id;

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Read the error detail (last panel text) — if it shows a warning like '横/竖双封面缺失', provide a cover image that satisfies dimension requirements
  2. Retry; transient slow detection may complete on a second run
  3. Use a smaller/standard-ratio cover image (e.g. 16:9 or 9:16 JPEG) to speed detection
  4. If panel copy changed, update stateTexts/ready checks in buildCoverCheckPanelTextJs (clis/douyin/draft.js:166) and waitForCoverReady (draft.js:199)

Example fix

// before
if (sawBusy && ready && !busy) return;
// after: accept completion without busy phase (fast cache hit)
if ((sawBusy || panelText.includes('快速检测')) && ready && !busy) return;
Defensive patterns

Strategy: retry

Try / catch

try {
  await opencli.douyin.draft({ video, title, cover });
} catch (e) {
  if (e.message.includes('等待抖音封面处理完成超时')) {
    // read detail panel text; if '横/竖双封面缺失' fix the image, else retry
  }
}

Prevention

When it happens

Trigger: Passing --cover and the cover-detection pipeline never completes: detection takes longer than 10s, the panel text changes to new wording the ready check doesn't recognize, or the panel text never appears at all (panelText stays '').

Common situations: Slow server-side cover analysis; Douyin renamed '重新检测'/'检测中' copy in a UI update; very large cover image slowing processing; detection panel only rendered after user scroll.

Related errors


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