Douyin video download skill, uses Playwright to control the browser and intercept API responses, bypasses Douyin's msToken/X-Bogus signature verification, and obtains the watermark-free video direct link and downloads it.
Core method
- Launch headless Chromium (Playwright)
- Visit the Douyin video page
- Intercept
aweme/detailAPI response - Extract from the JSON response
play_addr.url_list[0](watermark-free direct link) - Download with requests, with Referer to simulate the browser source
How to use
Download a single video
The user provides a Douyin link (the following formats are supported):
https://www.douyin.com/video/7611845735025364265https://www.douyin.com/jingxuan?modal_id=7611845735025364265- Any video URL under douyin.com
Run the script
Run the download script:
python3 yichen-douyin-fetcher/scripts/download.py "<抖音链接>" [输出路径]
Parameter description:
- Douyin link (required): video page URL
- Output path (optional): local save path, defaults to
~/Downloads/douyin_<video_id>.mp4 --metadata-only(optional): only scrape metadata, do not download the video, used to quickly check whether the link can be parsed--timeout 60(optional): waitaweme/detailseconds for the response
Example:
python3 yichen-douyin-fetcher/scripts/download.py "https://www.douyin.com/video/7611845735025364265"
python3 yichen-douyin-fetcher/scripts/download.py "https://www.douyin.com/video/7611845735025364265" "/tmp/my_video.mp4"
python3 yichen-douyin-fetcher/scripts/download.py "https://www.douyin.com/video/7611845735025364265" --metadata-only
Output information
After a successful download, returns:
- Video title (desc)
- Video size (MB)
- Save path
- Author information
- Generates in the same directory
<视频文件名>.metadata.json, containing concise metadata such as title, author, publish time, duration, and interaction data
Dependencies
- Python 3.9+
- playwright (
pip install playwright; if Chromium is missing on first run, the script will automatically executepython3 -m playwright install chromium) - requests
Notes
- The video link must contain a valid video_id
- Recommended page links need to be converted to the video detail page format (
/video/prefix) - The downloaded video is in watermark-free MP4 format
- Some videos may fail to download due to copyright or regional restrictions
- This skill is only responsible for scraping the video and metadata; when a spoken script is needed, continue calling
yichen-volc-asrfor transcription