v2.0.0 - Clean Architecture Edition
| Features | Description |
|---|---|
| Virtual Environment Setup | Automatic venv creation and dependency management. |
| One-Click Launch | Auto-setup and run with a single command. |
| Smart Popup Handling | Auto-dismisses alerts, clicks close buttons, removes overlays. |
| Automated Views | Automate video views on TikTok seamlessly. |
| Likes Automation | Perform automated likes on specified videos or profiles. |
| Comment Likes | Boost engagement by automating comment likes. |
| Dynamic Service Detection | Automatically detects available services on page load. |
| Continuous Execution | Automatically loops tasks until stopped by the user. |
| Professional Logging | File and console logging with automatic rotation. |
| Error Recovery | Robust error handling and automatic retries. |
| Clean Architecture | Modular, maintainable, and easy to extend. |
The TikTok Automation Bot leverages Python and Selenium WebDriver to automate TikTok interactions via Zefoy. Completely refactored with clean architecture and robust popup handling.
- Run the Script: Execute
python main.pyto start the bot with auto-setup and virtual environment. - Auto-Install: Virtual environment is created on first run, dependencies automatically installed.
- Solve the CAPTCHA: Manually complete the CAPTCHA on Zefoy.
- Auto Popup Removal: Bot automatically dismisses alerts and removes all consent/monetization dialogs.
- Select a Service: Choose from detected available services in the console.
- Enter Details: Provide video URL or username depending on service chosen.
- Relax: The script runs continuously until manually stopped.
-
Run the bot (automatic setup):
python main.py
- First run: Creates
venv/folder and installs all dependencies (~1 minute) - Subsequent runs: Instant startup using existing virtual environment
- First run: Creates
-
Complete CAPTCHA:
- Solve the CAPTCHA on the website
- Press Enter in the terminal when done
- Bot automatically dismisses notification alerts
- Bot clicks close buttons on consent dialogs
- Bot removes any remaining popups/overlays via JavaScript
-
Select service:
- View automatically detected available services
- Choose from: followers, hearts, views, shares, favorites, comment_hearts
-
Provide input:
- Enter TikTok URL(s) or username as requested
- Bot will continuously execute until you press Ctrl+C
- Python 3.6 or newer
- Google Chrome or Chromium browser
- ChromeDriver (compatible with your browser version)
git clone https://github.com/zebbern/Zefoy-Automation.git
cd Zefoy-Automationpython main.pyThe launcher handles everything else automatically!
If you prefer to install dependencies manually:
pip install -r requirements.txtZefoy-Automation/
βββ main.py # β Run this file (auto-setup with venv)
βββ venv/ # Virtual environment (auto-created)
βββ src/ # Python modules
β βββ bot.py # Main bot logic & popup handling
β βββ config.py # All settings & configuration
β βββ services.py # Service detection & operations
β βββ driver_manager.py # WebDriver management & anti-detection
β βββ actions.py # Reusable Selenium actions
β βββ logger.py # Logging system with rotation
β βββ validators.py # Input validation & sanitization
β βββ exceptions.py # Custom exception hierarchy
βββ script.js # JavaScript utilities
βββ requirements.txt # Python dependencies
βββ install_chromedriver.py # ChromeDriver auto-installer
βββ README.md # This file
python main.py-
Auto-Setup Check
- Verifies Python version (3.6+)
- Creates virtual environment (
venv/) on first run - Checks if dependencies are installed in venv
- Offers to auto-install if missing
-
Browser Opens
- Chrome opens and navigates to Zefoy.com
- Initial consent popup is handled (alert dismissal + close button click)
- You solve the CAPTCHA manually and press Enter
-
Post-CAPTCHA Cleanup
- Bot automatically dismisses browser notification alerts
- Clicks close buttons on consent/monetization dialogs
- Removes any remaining overlay popups via JavaScript
- Waits for page to stabilize
-
Service Detection
- Bot checks which services are currently available
- Console shows detected services with status:
- [1] followers - [β WORKING] or [β OFFLINE]
- [2] hearts (likes)
- [3] comment_hearts
- [4] views
- [5] shares
- [6] favorites
-
Provide Input
- For most services: Enter TikTok video URLs (space-separated)
- For comment hearts: Enter username and target URL
-
Automation Runs
- Bot performs the selected action continuously
- Press Ctrl+C to stop
- Automatic venv creation on first run
- Isolated dependency management
- No reinstallation needed on subsequent runs
- One-time setup (~1 minute)
- Browser alert dismissal (notification requests)
- Automatic close button clicking on consent dialogs
- JavaScript-based removal for stubborn popups
- Handles consent, monetization, and message overlays
- Multi-layer approach for maximum reliability
- Automatically checks service availability on page load
- Real-time status display (β WORKING / β OFFLINE)
- Updated XPath detection for accurate button location
- No hardcoded assumptions about page structure
- Modular design with separation of concerns
- 8 specialized modules for different responsibilities
- Easy to maintain and extend
- Professional code quality with type hints
- Console output with color coding (colorama)
- File logging:
zefoy_bot.log - Automatic log rotation (10MB max, 5 backups)
- Multiple log levels (DEBUG, INFO, WARNING, ERROR)
- Custom exception types for specific errors
- Automatic retry logic for failed operations (3 retries with 2s delay)
- Graceful degradation on failures
- Detailed error messages with stack traces
- URL format validation
- Username format checking (@username)
- Input sanitization for security
- Clear error messages for invalid inputs
All settings in one place (src/config.py):
- Service wait times (randomized delays)
- XPath locators (auto-updated)
- CSS selectors for popups
- Timeout settings
- Retry configurations
- ChromeDriver options
Edit src/config.py:
SERVICE_WAIT_TIMES = {
"views": (125, 135), # Random wait between 125-135 seconds
"hearts": (125, 135),
"comment_hearts": (70, 70),
# ... modify as needed
}Edit src/config.py:
SERVICES = {
"new_service": ("/xpath/to/button", 13)
}
SERVICE_WAIT_TIMES = {
"new_service": (100, 120)
}No code changes needed - it's automatically detected!
Install manually:
pip install -r requirements.txtRun the installer:
chromedriveinstall.bat # WindowsOr install manually from ChromeDriver Downloads
Check the log file:
cat zefoy_bot.log # Linux/Mac
type zefoy_bot.log # WindowsSome services may be temporarily unavailable on Zefoy. Try:
- Refreshing the page
- Selecting a different service
- Waiting a few minutes and trying again
nohup python main.py > output.log 2>&1 &Check zefoy_bot.log for detailed debug information.
- β Complete refactor with modular architecture
- β
Auto-setup launcher (
main.py) - β Professional logging system
- β Input validation and sanitization
- β Custom exception handling
- β Retry logic for robustness
- β
Organized code structure (
src/folder) - β Type hints throughout
- β Comprehensive documentation
- Basic automation functionality
- Manual setup required
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is for educational purposes only. Use responsibly and at your own risk.
Made with
β Star this repo if you find it useful!
This bot automates interactions with third-party services. Use at your own risk. The author is not responsible for any consequences of using this software.
A special thanks to Zefoy for providing the platform for automation.
Warning
This project is for educational purposes only and is not affiliated with TikTok or Zefoy. Users are responsible for ensuring compliance with TikTok's terms of service. Use responsibly and ethically.