TikTok Upload Video & Caption

🌐 Browser Automation javascript browser_script v1 📊 Used 2 times 🌐 tiktok.com

Mengunggah video ke TikTok, mengisi caption, dan menekan tombol Post.

Runtime Environment

  • Runtime: browser_script
  • Platform: tiktok.com
  • Last Verified: 2026-04

Pre-Conditions

  • Logged in to TikTok
  • On upload page

CSS Selectors

{
  "file_input": "input[type='file']",
  "caption_editor": "[contenteditable='true'], .public-DraftEditor-content",
  "post_btn": "button:has-text('Post')"
}

⚡ Executable Code

async function uploadTikTok(filePath, caption) {
  // 1. Upload file via Flowork tool upload_to_page
  // 2. Set Caption
  const editor = document.querySelector('[contenteditable="true"], .public-DraftEditor-content');
  if (editor) {
    editor.focus();
    document.execCommand('insertText', false, caption);
  }
  // 3. Click Post
  const buttons = Array.from(document.querySelectorAll('button'));
  const postBtn = buttons.find(b => b.textContent.trim() === 'Post');
  if (postBtn) postBtn.click();
}

Expected Result

  • Video published toast appears

Success Indicators

  • document.body.innerText.includes('Video published')

Statistics

2Times Used
0%Success Rate
v1Version
INDEXED KEYWORDS:
tiktok upload video post