| name | douyin-downloader |
| description | Download Douyin (抖音) videos without watermarks using a local Docker-based API service. Supports video data extraction and batch downloads. |
| metadata | {"author":"Ming Fang","version":"1.0.0"} |
Douyin Downloader — 抖音视频无水印下载
Self-hosted Douyin/TikTok video downloader via Docker API.
⚠️ 隐私 & 安全声明
🔴 核心风险
Cookie = 完整登录会话:
- 获取 Cookie 需要登录抖音账号
- Cookie 包含完整登录会话,相当于账号密码
- 如果泄露,他人可以完全控制你的抖音账号(发布、私信、设置等)
第三方镜像:
- 本 skill 使用
evil0ctal/douyin_tiktok_download_api(非本作者创建)
- 镜像作者: Evil0ctal (GitHub)
- 协议: Apache-2.0 (开源)
🛡️ 强烈建议
- ✅ 使用专用测试账号(不含真实身份/私信/敏感内容)
- ✅ 不要使用主账号 Cookie
- ✅ 审查 源代码 或自行构建镜像
- ✅ 定期在抖音 APP 退出登录(使旧 Cookie 失效)
- ✅ 不要分享包含 Cookie 的配置文件
📖 数据安全
- Cookie 存储: 仅本地容器内 (
/app/crawlers/douyin/web/config.yaml)
- 网络请求: 仅向
*.douyin.com 发送(可通过 docker logs 验证)
- 不上传外部: 本 skill 不会上传 Cookie 到其他服务器(基于源码审查)
详细说明: PRIVACY.md
Prerequisites
Docker container must be running:
docker ps | grep douyin_api
If not running, start it:
docker start douyin_api
Quick Start
Download a video
curl -L "http://localhost:8080/api/download?url=<抖音链接>&prefix=false&with_watermark=false" -o video.mp4
Get video metadata
curl -s "http://localhost:8080/api/hybrid/video_data?url=<抖音链接>" | jq
Cookie Management
Douyin requires valid cookies for API access. Cookies expire every 1-2 weeks.
Update cookies
Step 1: Get Cookie from browser
- Open
douyin.com in Chrome and login
- Press
F12 → Network tab
- Refresh page (
Cmd+R)
- Click any request
- Find
Request Headers → Cookie:
- Right-click → Copy value (entire line)
Step 2: Run update script
scripts/update-cookie.sh "your-cookie-string"
The script will:
- Update Docker config
- Restart container
- Show startup logs
API Endpoints
Base URL: http://localhost:8080
/api/hybrid/video_data
Get video metadata (author, likes, description, etc.)
Parameters:
url (required): Douyin share URL
Example:
curl "http://localhost:8080/api/hybrid/video_data?url=https://v.douyin.com/xxxxx/"
/api/download
Download video without watermark
Parameters:
url (required): Douyin share URL
prefix (optional): Add filename prefix (default: false)
with_watermark (optional): Include watermark (default: false)
Example:
curl -L "http://localhost:8080/api/download?url=https://v.douyin.com/xxxxx/&prefix=false&with_watermark=false" -o video.mp4
Supported URL Formats
All Douyin share formats work:
- Short URL (app share):
https://v.douyin.com/xxxxx/
- Long URL (web):
https://www.douyin.com/video/1234567890
- Share text (with 口令):
7.43 pda:/ 复制此链接...
Service Management
Check status
docker ps | grep douyin_api
docker logs douyin_api --tail 20
Restart
docker restart douyin_api
Stop/Start
docker stop douyin_api
docker start douyin_api
Troubleshooting
Error: "响应内容为空" or "无效响应类型"
Cause: Cookie expired
Fix: Update cookie using the update script (see Cookie Management section)
Error: Connection refused
Cause: Docker container not running
Fix:
docker start douyin_api
Error: Rate limited
Cause: Too many requests in short time
Fix: Wait 1-2 minutes, then retry
Technical Details
- Docker Image:
evil0ctal/douyin_tiktok_download_api:latest
- Container Name:
douyin_api
- Port: 8080 (host) → 80 (container)
- Config:
/app/crawlers/douyin/web/config.yaml
- Cookie Location: Same config file,
Cookie: line
- Update Script:
~/.openclaw/workspace/chrome-cookie-sniffer/update_douyin_cookie.sh
Docker Setup (Initial)
If container doesn't exist:
docker pull evil0ctal/douyin_tiktok_download_api:latest
docker run -d --name douyin_api -p 8080:80 evil0ctal/douyin_tiktok_download_api:latest
Then update cookies (see Cookie Management).
Batch Downloads (Shell Script)
#!/bin/bash
URLS=(
"https://v.douyin.com/xxxxx/"
"https://v.douyin.com/yyyyy/"
"https://v.douyin.com/zzzzz/"
)
for i in "${!URLS[@]}"; do
curl -L "http://localhost:8080/api/download?url=${URLS[$i]}&prefix=false&with_watermark=false" \
-o "video_$i.mp4"
echo "Downloaded video $i"
sleep 2
done
Python Example
import requests
API = "http://localhost:8080"
def download_douyin(url: str, output: str):
"""Download Douyin video without watermark"""
r = requests.get(f"{API}/api/download",
params={"url": url, "prefix": "false", "with_watermark": "false"},
stream=True)
r.raise_for_status()
with open(output, "wb") as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
return output
def get_video_info(url: str):
"""Get video metadata"""
r = requests.get(f"{API}/api/hybrid/video_data", params={"url": url})
r.raise_for_status()
return r.json()
url = "https://v.douyin.com/xxxxx/"
info = get_video_info(url)
print(f"Title: {info['data']['desc']}")
print(f"Author: {info['data']['author']['nickname']}")
print(f"Likes: {info['data']['statistics']['digg_count']}")
download_douyin(url, "video.mp4")
Rate Limits
- Local API, no external rate limits
- Limited only by your network speed and Docker resources
- Recommended: 2-3 seconds between downloads to avoid triggering Douyin's anti-scraping
Cookie Lifespan
- Typical: 1-2 weeks
- With frequent use: May extend to 3-4 weeks
- Signs of expiration: API returns empty responses or "无效响应类型"
- Renewal: Re-login to douyin.com and copy new cookie
Web UI
API documentation available at:
http://localhost:8080/docs
Interactive Swagger UI for testing endpoints.
Credits
Based on Douyin_TikTok_Download_API by Evil0ctal.