# Douyin Browser Capture This tool drives a real Playwright Chromium session, lets a human log into Douyin, captures the loaded profile and work pages, and can sync the captured bundle into StoryForge's existing `/v2/douyin/accounts/sync` endpoint. ## Install ```bash cd /Users/kris/code/StoryForge-gitea/scripts/douyin-browser-capture npm install npx playwright install chromium ``` ## Run ```bash cd /Users/kris/code/StoryForge-gitea/scripts/douyin-browser-capture npm run capture -- \ --profile-url https://www.douyin.com/user/your_account \ --storyforge-username kris \ --storyforge-password 'Asd123456.' ``` The browser uses a persistent state directory under `~/.storyforge/douyin-playwright`, so Douyin login can survive between runs. ## Control Panel If you do not want to remember CLI arguments, start the local control panel: ```bash cd /Users/kris/code/StoryForge-gitea/scripts/douyin-browser-capture npm run control-panel ``` Then open [http://127.0.0.1:3618](http://127.0.0.1:3618) and use this flow: 1. Fill in the Douyin profile URL and StoryForge credentials. 2. Click `开始采集`. 3. A real Chromium window opens. Log into Douyin and solve any captcha there. 4. Return to the control panel and click `已完成登录,继续采集`. 5. Wait for `summary.json` and the optional StoryForge sync result. The control panel stores each run under: `/Users/kris/code/StoryForge-gitea/output/playwright/douyin/control-panel` ## What it captures - current profile page JSON blobs extracted from `