jackwener/OpenCLI · error · CommandExecutionError
等待抖音草稿编辑页超时
Error message
等待抖音草稿编辑页超时
What it means
waitForDraftComposer polls the Douyin creator upload page up to 120 times (0.5s apart, ~60s total) for the composer being ready — detected by an input whose placeholder contains '填写作品标题' and a button containing '暂存离开'. If the composer never appears within the timeout, it throws this CommandExecutionError with the last page URL as detail. It means the video upload did not complete or the page did not transition to the draft-editing composer.
Source
Thrown at clis/douyin/draft.js:57
href: '',
ready: false,
bodyText: '',
};
for (let attempt = 0; attempt < COMPOSER_WAIT_ATTEMPTS; attempt += 1) {
lastState = (await page.evaluate(`() => ({
href: location.href,
ready: !!Array.from(document.querySelectorAll('input')).find(
(el) => (el.placeholder || '').includes('填写作品标题')
) && !!Array.from(document.querySelectorAll('button')).find(
(el) => (el.textContent || '').includes('暂存离开')
),
bodyText: document.body?.innerText || ''
})`));
if (lastState.ready)
return;
await page.wait({ time: 0.5 });
}
throw new CommandExecutionError('等待抖音草稿编辑页超时', `当前页面: ${lastState.href || 'unknown'}`);
}
/**
* Fill title, caption and visibility controls on the live composer page.
*/
async function fillDraftComposer(page, options) {
const titleOk = (await page.evaluate(`() => {
const titleInput = Array.from(document.querySelectorAll('input')).find(
(el) => (el.placeholder || '').includes('填写作品标题')
);
if (!(titleInput instanceof HTMLInputElement)) return false;
const propKey = Object.keys(titleInput).find((key) => key.startsWith('__reactProps$'));
const props = propKey ? titleInput[propKey] : null;
if (props?.onChange) {
props.onChange({
target: { value: ${JSON.stringify(options.title)} },
currentTarget: { value: ${JSON.stringify(options.title)} },
});
} else {View on GitHub (pinned to 49907e53dc)
Solutions
- Check the error detail (当前页面: <href>) — if it is a login/risk-control URL, re-authenticate / refresh cookies and retry
- Re-run the command; transient slow uploads may just need the retry (progress resumes from draft if partially saved)
- Use a smaller/compressed video or a more stable network to finish upload within the 60s window
- Manually open the upload URL to dismiss any new modals or confirm the composer still uses '填写作品标题' / '暂存离开' text; update selectors in clis/douyin/draft.js if Douyin changed them
Example fix
// before: fail hard on timeout
throw new CommandExecutionError('等待抖音草稿编辑页超时', `当前页面: ${lastState.href || 'unknown'}`);
// after: surface actionable state / retry once on slow upload
if (lastState.bodyText.includes('重新上传')) {
await page.setFileInput([videoPath], 'input[type="file"]');
// restart the wait loop
} else {
throw new CommandExecutionError('等待抖音草稿编辑页超时', `当前页面: ${lastState.href || 'unknown'}`);
} Defensive patterns
Strategy: retry
Validate before calling
// pre-check auth/page reachability before invoking
curl -s -o /dev/null -w '%{http_code}' https://creator.douyin.com/creator-micro/content/upload \
-H "Cookie: $DOUYIN_COOKIE" # expect 200, not a login redirect Try / catch
try {
await opencli.douyin.draft({ video, title });
} catch (e) {
if (e.message.includes('等待抖音草稿编辑页超时')) {
// inspect e.detail for '当前页面: <href>' — re-auth if login page, else retry once
}
} Prevention
- Keep creator.douyin.com cookies fresh before long upload runs
- Compress large videos so the upload finishes within the ~60s composer wait
- Watch for Douyin UI changes to '填写作品标题'/'暂存离开' and update selectors
- Run during off-peak hours to avoid risk-control interstitials
When it happens
Trigger: Calling the douyin draft CLI with a video, then the upload stalls or the page never navigates to the composer within 60 seconds: slow network upload, Douyin showing an unexpected modal/interstitial, login cookie expired redirecting to a login page, or Douyin changed composer DOM (placeholder/button text).
Common situations: Expired or invalid creator.douyin.com cookies; very large video on slow connection; Douyin A/B testing that renamed the title placeholder or '暂存离开' button; risk-control (验证码) interstitial after upload; upload error dialog left open.
Related errors
- 等待抖音封面处理完成超时
- 未检测到抖音草稿恢复提示
- Unexpected 12306 probe: ${JSON.stringify(probe)}
- ChatGPT did not create a conversation URL after sending the
- Failed to upload file to ChatGPT project knowledge: ${err in
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/2d99cac7923255cf.
Report an issue: GitHub.