A simple and powerful CLI tool to batch download TikTok videos and audio.
git clone https://github.com/kwishtt/tikdl.git
cd tikdlpip install -r requirements.txt# yt-dlp
pip install yt-dlp
# ffmpeg (Ubuntu/Debian)
sudo apt install ffmpeg
# ffmpeg (macOS)
brew install ffmpeg
# ffmpeg (Windows)
# Download from https://ffmpeg.org/download.htmlCreate user.txt with TikTok profile URLs (one per line):
https://www.tiktok.com/@username1
https://www.tiktok.com/@username2
https://www.tiktok.com/@username3
python3 ytdl.pyChoose download format:
[1] Video (MP4) Video only
[2] Audio (MP3) Audio only
[3] Both Video + Audio
Enter choice [1/2/3] (1):
The tool will:
- Scan all users
- Show a summary table
- Download with progress bar
- Save files to
TikTok_Downloads/@username/
TikTok_Downloads/
├── @username1/
│ ├── video_title_abc123.mp4
│ ├── video_title_def456.mp4
│ └── .video_archive # (hidden) tracks downloaded videos
├── @username2/
│ └── ...
└── .download_cache.json # (hidden) smart skip cache
Edit these variables in ytdl.py:
# Anti-block settings
MIN_DELAY = 3 # Min delay between users (seconds)
MAX_DELAY = 8 # Max delay between users (seconds)
# Smart skip
SKIP_HOURS = 24 # Skip if checked within X hours| Feature | Description |
|---|---|
| Random delay | 3-8s random delay between users |
| Sleep requests | 1.5s delay between HTTP requests |
| Sleep interval | 2-5s random delay between videos |
| Retry mechanism | Auto-retry on failure (max 5 times) |
| Exponential backoff | Increasing wait time on rate limit (429) |
| Browser cookies | Uses Chrome cookies for authentication |
The tool remembers when each user was last checked. If:
- User was checked within 24 hours, AND
- No new videos were found last time
The user will be skipped to save time.
To force re-download all users, delete:
rm TikTok_Downloads/.download_cache.json- Switch to mobile data (3G/4G)
- Wait 10-30 minutes
- Use a VPN
- Update yt-dlp:
pip install -U yt-dlp - Check if profile is private
- Try with different browser cookies
# Ubuntu/Debian
sudo apt install ffmpeg
# Check installation
ffmpeg -versionMIT License - feel free to use and modify!
Pull requests are welcome! For major changes, please open an issue first.
