Extract Douyin web data via agent-browser, no official API Key required.
Prerequisites
- Install agent-browser:
npm install -g agent-browser && agent-browser install - Log in to Douyin (choose one):
- Recommended: Log in to Douyin in Chrome, then use
--auto-connectmode - Or:
python douyin.py login(launch a separate browser to log in)
- Recommended: Log in to Douyin in Chrome, then use
Verify login status:
python skills/douyin-cli/douyin.py status
Trigger conditions
Use this Skill in the following cases:
- The user wants to search Douyin content
- The user wants to view the details or comments of a Douyin video
- The user wants to learn about a Douyin creator's homepage and posts
- The user sent a douyin.com link
Search
python skills/douyin-cli/douyin.py search "关键词" # 搜索视频
python skills/douyin-cli/douyin.py search "关键词" --user # 搜索用户
python skills/douyin-cli/douyin.py search "关键词" --auto-connect # 用 Chrome(推荐)
Video details and comments
python skills/douyin-cli/douyin.py detail <aweme_id> # 视频详情
python skills/douyin-cli/douyin.py comments <aweme_id> # 评论列表
python skills/douyin-cli/douyin.py video <aweme_id> # 详情 + 评论
aweme_id is obtained from search results or the video URL (the number after/video/ ).
User info
python skills/douyin-cli/douyin.py user <sec_user_id> # 用户主页
python skills/douyin-cli/douyin.py posts <sec_user_id> # 用户作品列表
sec_user_id is obtained from the user homepage URL (the string after/user/ ).
Pagination and export
python skills/douyin-cli/douyin.py more [次数] # 滚动加载更多(默认3次)
python skills/douyin-cli/douyin.py export results.json # 导出为 JSON
python skills/douyin-cli/douyin.py export results.csv --csv # 导出为 CSV
export Export the results of the last search/posts command.
Two run modes
auto-connect mode (recommended)
Connect to the user's logged-in Chrome to bypass CAPTCHAs:
python douyin.py search "关键词" --auto-connect
Prerequisite: Chrome is open and logged in to Douyin. All commands support the --auto-connect option.
profile mode (default)
Use a separate browser + persistent profile:
python douyin.py login # 首次登录
python douyin.py search "关键词" # 后续使用
Typical workflow
"Help me search Douyin for videos about XX"
search "XX"Search- For videos of interest,
video <id>view details + comments - Summarize and return
"Help me check out this Douyin creator"
user <sec_user_id>Get homepageposts <sec_user_id>View post list
"Export the search results for me"
search "关键词"Searchmore 5Load moreexport results.csv --csvExport
Notes
- Douyin has strict anti-scraping measures; high-frequency requests may trigger CAPTCHAs
- auto-connect mode connects to the user's real Chrome, with the lowest CAPTCHA probability
- profile mode requires login on first use
- Comments require page scrolling to trigger loading, so the first fetch may be incomplete
- A search interval of 5 seconds or more is recommended