Automatically monitor TikTok users and intelligently download only new videos. Features timestamp-based tracking to avoid duplicates and anti-bot behavior to appear human-like.
- π€ Automatic monitoring - Periodically checks for new videos
- π― Smart timestamp filtering - Downloads only truly new videos (no duplicates)
- ποΈ SQLite database - Tracks downloaded videos and metadata
- π Automatic geo-bypass - Circumvents geographical restrictions
- πͺ Cookie support - For restricted or private videos
- β±οΈ Anti-bot delays - Randomized delays between downloads
- π Desktop notifications - Get alerted when new videos are downloaded
- π Professional logging - Detailed logs with file and console output
- π Automatic retry - Handles network errors and rate limiting
- π Reports & statistics - View downloads, views, likes
- π₯ Multi-user - Monitor multiple users simultaneously
- π¨ Interactive menu - User-friendly CLI with guided options
- π Organized downloads - Files named by author and date
- βοΈ Configuration file - Customize settings with config.yaml
Even if you're not in a restricted country, using a VPN is strongly recommended:
- β Better privacy - Masks your IP address from TikTok
- β Avoid rate limiting - Reduces risk of temporary bans
- β Consistent downloads - More stable connection to TikTok servers
- β Geographic diversity - Access content from different regions
Recommended VPN locations:
- πΊπΈ United States (best compatibility)
- π¨π¦ Canada
- π©πͺ Germany
IMPORTANT
Note: Restrictions change frequently. Some videos may be unavailable in specific regions regardless of country-level restrictions.
Setup:
# 1. Connect to VPN (USA recommended)
# 2. Run the monitor
python tiktok_monitor.py --auto --users username
# The built-in geo-bypass will work better with VPN active
## π Installation
### Requirements
- Python 3.7 or higher
- pip (Python package manager)
### Quick Setup
```bash
# 1. Clone the repository
git clone https://github.com/gabrielrahbar/TikTokAutoDownloader.git
cd TikTokAutoDownloader
# 2. Install dependencies
pip install -r requirements.txt
# 3. Verify installation
python check_installation.pyIf you see this output, you're ready:
β
EVERYTHING OK! Installation completed successfully!
The easiest way to get started:
python tiktok_monitor.pyYou'll see this menu:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TikTok Monitor - Main Menu v2.3 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π₯ USER MANAGEMENT
1. β Add user to monitor
2. π List monitored users
3. β Remove user from monitoring
...
Example workflow:
- Choose
1to add a user (e.g.,charlidamelio) - Choose
7to start automatic monitoring - The bot will check every 30 minutes [Default] (you can choose it) and download new videos
# Add users and start automatic monitoring (every 30 min)
python tiktok_monitor.py --auto --interval 30 --users charlidamelio khaby.lame
# Check once only (no loop)
python tiktok_monitor.py --check-once --users charlidamelio
# Show statistics
python tiktok_monitor.py --statsTo download a single video:
# Basic download
python tiktok_downloader_advanced.py https://www.tiktok.com/@user/video/123456789
# With cookies (for geo-restrictions)
python tiktok_downloader_advanced.py --cookies tiktok_cookies.txt URL
# Show cookie export instructions
python tiktok_downloader_advanced.py --help-cookiesQuick script to manage users without interactive menu:
# List all monitored users
python manage_users.py --list
# Add new user
python manage_users.py --add username
# Remove user (disable)
python manage_users.py --remove username
# Permanently delete (with confirmation)
python manage_users.py --delete username
# Re-enable disabled user
python manage_users.py --enable usernameCustomizable settings using a config.yaml file in the project root.
monitor:
interval_minutes: 30
output_dir: "./tiktok_downloads"
download:
quality: "best"
geo_bypass: true
notifications:
enabled: falseView detailed download report:
python view_report.pyExample output:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TikTok Monitor Report β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π GENERAL STATISTICS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Downloaded videos: 142
Total views: 1,245,890
Total likes: 89,234
π₯ BY AUTHOR
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
@charlidamelio 45 videos | 890,234 views | 67,123 likes
@khaby.lame 38 videos | 234,567 views | 12,345 likes
...
If you get errors like "Video not available in your country":
-
Install "Get cookies.txt LOCALLY" extension
-
Go to tiktok.com and login
-
Click extension icon β
Export -
Save as
tiktok_cookies.txt -
Use cookies:
python tiktok_downloader_advanced.py --cookies tiktok_cookies.txt URL
Connect to a VPN (USA/UK) before running downloads. The automatic geo-bypass will handle the rest.
TikTokAutoDownloader/
βββ tiktok_monitor.py # π€ Main monitor with interactive menu
βββ tiktok_downloader_advanced.py # π₯ Standalone downloader
βββ manage_users.py # π₯ CLI user management
βββ view_report.py # π Reports and statistics
βββ check_installation.py # β
Installation verification
βββ requirements.txt # π¦ Python dependencies
βββ README.md # π This guide
βββ LICENSE # βοΈ MIT License
βββ .gitignore # π« Files to ignore
βββ tiktok_downloads/ # π Downloaded videos (auto-created)
βββ tiktok_monitor.db # ποΈ SQLite database (auto-created)
The monitor uses an intelligent timestamp-based system:
- First run: Saves the timestamp of the most recent video
- Subsequent checks: Downloads only videos with timestamp > last saved
- Anti-duplicates: Also checks database for safety
- Update: Always saves the timestamp of the newest downloaded video
This prevents the "false new videos" problem that other scrapers have.
To avoid TikTok bans:
- β±οΈ Randomized delays between downloads (5-15 seconds)
- π² Delays between different users (10-30 seconds)
- π User-Agent rotation
- π Variable check intervals (Β±10%)
The SQLite database tracks:
- videos: id, url, title, author, timestamp, likes, views, file_path
- monitored_users: username, last_check, last_video_timestamp, total_videos
pip install --upgrade yt-dlpUse cookies (see Cookies section above) or connect to a VPN.
Close all monitor instances before restarting:
# Linux/Mac
pkill -f tiktok_monitor.py
# Windows (Task Manager)
Search "python" and close the processesIncrease timeout by modifying yt-dlp options in code or use a more stable connection.
The bot is going too fast. Increase delays in tiktok_monitor.py:
# Around line ~300
delay = random.uniform(10, 20) # Increase these valuespython check_installation.pyContributions are welcome!
- Fork the project
- Create a branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
See CONTRIBUTING.md for details.
For personal and educational use only.
- βοΈ Respect TikTok's Terms of Service
- π Video rights belong to their respective authors
- π« Do not use to redistribute content without permission
β οΈ The author is not responsible for misuse of this software
- π― User-friendly error handling with clear solutions
- π ConfigManager for YAML-based configuration
- π Desktop notifications for new downloads
- π Professional logging system with daily rotation
- π Smart retry logic based on error type
- β Integration tests for TikTok API
- π§ͺ Comprehensive unit tests
- β¨ Added timestamp-based filtering (no more duplicates)
- π― Limited check to last 5 videos per user
- π οΈ Improved anti-bot with randomized delays
- π Added
view_report.pyfor statistics - π₯ Added
manage_users.pyfor CLI - β
Added
check_installation.py
- π Initial release
- π€ Basic automatic monitoring
- π₯ Download with geo-bypass
Author: gabrielrahbar
- GitHub: @gabrielrahbar
- Issues: Report a problem
This project is released under the MIT License. See the LICENSE file for details.
β If this project is useful to you, leave a star on GitHub! β
Made with β€οΈ by gabrielrahbar