A powerful and accurate bot detection and blocking system for X (Twitter) that protects users from automated accounts, spam, and malicious bots while maintaining high accuracy and minimal false positives.
-
🔍 Advanced Bot Detection
- Profile analysis
- Content analysis
- Image analysis
- Pattern recognition
- Language detection
- Behavior analysis
-
🛡️ Protection
- Automated blocking
- Rate limit management
- Whitelist/blacklist support
- Block history tracking
-
⚙️ Configuration
- YAML-based settings
- Hot-reload support
- Environment variables
- Customizable thresholds
- ✅ Phase 1: Foundation (Completed)
- Configuration Management
- Blocked Accounts Tracking
- Rate Limit Optimization
- 🔄 Phase 2: Core Enhancement (In Progress)
- Enhanced Bot Detection
- Monitoring & Alerts
- Clone the repository:
git clone https://github.com/yourusername/x-bot-blocker.git
cd x-bot-blocker
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables:
cp .env.example .env
# Edit .env with your X API credentials
- Configure settings:
cp config.yaml.example config.yaml
# Edit config.yaml with your preferences
- Start the bot:
python x_bot_blocker.py
- Monitor the logs:
tail -f bot_blocker.log
- Export blocked accounts:
python export_blocked.py
The bot uses a YAML configuration file (config.yaml
) for settings:
api:
rate_limit:
max_blocks_per_day: 1000
cooldown_period: 60
bot_detection:
min_account_age_days: 30
min_followers: 10
max_following_ratio: 10
min_tweets: 5
bot_probability_threshold: 0.7
scanning:
mentions_count: 200
followers_count: 200
likes_count: 200
scan_interval: 60
x-bot-blocker/
├── config.yaml # Configuration settings
├── requirements.txt # Python dependencies
├── x_bot_blocker.py # Main bot script
├── config_manager.py # Configuration management
├── bot_detection.py # Bot detection logic
├── image_analysis.py # Image analysis module
└── blocked_accounts.csv # Blocked accounts database
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
python -m pytest tests/
- Core Focus - Project goals and scope
- Implementation Plan - Development roadmap
- API Documentation - API reference
- User Guide - Usage instructions
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please:
- Check the documentation
- Search existing issues
- Create a new issue if needed
- X API for providing the platform
- OpenCV for image analysis
- LangDetect for language detection
- All contributors and users