A sophisticated bot protection system for YouTube channels that guards against spam comments, fake views, and malicious bot activities.
- 🤖 Bot Detection & Prevention
- 👮 Spam Comment Filtering
- 📊 View Bot Detection
- ⚡ Rate Limiting
- 🔒 Channel Monitoring
-
GitHub Setup
- Create a GitHub account at github.com
- Navigate to this project's repository
- Click the green "Code" button
- Select "Codespaces" from the dropdown
- Click "Create codespace"
-
YouTube API Setup
- Go to Google Cloud Console
- Create a new project
- Enable YouTube Data API v3
- Create API credentials (API Key)
- Copy your API key
-
Configuration
- In the codespace, find
example.ts
- Replace these values:
const API_KEY = 'YOUR_YOUTUBE_API_KEY'; const CHANNEL_ID = 'YOUR_CHANNEL_ID'; const VIDEO_ID = 'YOUR_VIDEO_ID';
- In the codespace, find
-
Running the Protection
- In the codespace terminal, run:
npm install npm start
- In the codespace terminal, run:
-
Local Setup
# Clone the repository git clone [repository-url] cd bot-attack-on-live-stream # Install dependencies npm install typescript ts-node @types/node googleapis --save-dev # Start the protection system npm start
-
Project Structure
bot-attack-on-live-stream/ ├── BotProtector.ts # Main protection logic ├── example.ts # Usage example ├── tsconfig.json # TypeScript configuration └── package.json # Project dependencies
-
Key Components
-
Rate Limiting
RATE_LIMIT = 100 // requests per minute BLOCK_DURATION = 3600000 // 1 hour block duration
-
View Bot Detection
VIEW_THRESHOLD = 30 // suspicious views per minute VIEW_PATTERN_WINDOW = 300000 // 5 minute monitoring window
-
Parameter | Default | Description |
---|---|---|
RATE_LIMIT | 100 | Maximum requests per minute |
VIEW_THRESHOLD | 30 | Suspicious views trigger |
BLOCK_DURATION | 1 hour | Duration of IP blocks |
- Detects spam patterns
- Blocks sub4sub attempts
- Filters excessive links
- Auto-moderates suspicious comments
- Monitors view patterns
- Detects artificial traffic
- Reports suspicious activity
- Tracks viewer behavior
- Real-time activity tracking
- Automated response system
- Pattern recognition
- Abuse reporting
-
API Key Issues
Error: API key not valid Solution: Ensure YouTube Data API is enabled in Google Cloud Console
-
Rate Limiting
Error: Quota exceeded Solution: Check your Google Cloud Console quotas
- Never share your API key
- Keep monitoring thresholds reasonable
- Regularly update dependencies
- Monitor system logs
- Fork the repository
- Create feature branch
- Commit changes
- Push to branch
- Create Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support:
- Check existing issues
- Create new issue with details
- Join our community discussions
Subscribe to releases for notifications about:
- Security updates
- New features
- Bug fixes
- Performance improvements