TwitchDropsFarmer
A lightweight web application for automated Twitch drop farming that runs in a Docker container with minimal resource usage.
Install / Use
/learn @fireph/TwitchDropsFarmerREADME
TwitchDropsFarmer
A Go-based implementation of TwitchDropsMiner with a modern web interface and comprehensive API. This application automatically farms Twitch drops by watching streams using the exact same proven methods as the original TwitchDropsMiner.
[!WARNING] This project is still very much a work in progress and not feature complete yet! Farming drops is working but claiming drops does not work correctly yet.
Key Features
- 🎯 Exact TDM Logic: Uses identical GraphQL operations and authentication methods as TwitchDropsMiner
- 📊 Real-time Progress: Live drop progress tracking using Twitch's DropCurrentSessionContext API
- 🔄 Sequential Drop Support: Handles multi-drop campaigns (30min → 90min → 180min sequences)
- 🌐 Modern Web Interface: Real-time dashboard with WebSocket updates
- 🔧 Comprehensive API: Full REST API for external integrations
- 🤖 Device Flow Auth: Secure OAuth using Twitch's Android app credentials (no app setup required)
- ⚡ Auto-switching: Intelligent stream selection and campaign switching
- 📱 Mobile-friendly: Responsive design that works on all devices
Screenshots
Similar layout to the original TwitchDropsMiner but with a modern, dark-mode interface.
Quick Start
Prerequisites
- Go 1.24 or higher
- No Twitch app setup required! (Uses official Android app like TDM)
Installation
- Clone the repository:
git clone <repository-url>
cd TwitchDropsFarmer
- Install dependencies:
go mod tidy
- Run the application:
go run .
- Open your browser and navigate to
http://localhost:8080
Note: All user data is stored locally (tokens in SQLite, settings in config files).
Configuration
Environment Variables
SERVER_ADDRESS: Server listen address (default::8080)DATABASE_PATH: SQLite database file path (default:drops.db)WEBHOOK_URL: Optional webhook URL for notifications
Settings
The application includes a web-based settings interface where you can configure:
- Priority Games: Games to prioritize for drop farming
- Auto-claim: Automatically claim completed drops
- Check Interval: How often to check for updates (seconds)
- Switch Threshold: How long to watch a stream before switching (minutes)
- Theme: Light or dark mode
API Documentation
The application provides a comprehensive REST API for programmatic access:
Authentication Endpoints
GET /api/auth/url- Get OAuth device flow authorization URLPOST /api/auth/callback- Complete OAuth device flow with device codePOST /api/auth/logout- Logout and revoke tokensGET /api/auth/status- Check authentication status and user info
Drop Mining Endpoints
GET /api/miner/status- Get detailed miner status (campaigns, streams, progress)GET /api/miner/current-drop- Get currently active drop with real-time progressGET /api/miner/progress- Get progress for all drops (completed + current + pending)POST /api/miner/start- Start the drop mining processPOST /api/miner/stop- Stop the drop mining process
Campaign Endpoints
GET /api/campaigns/- List all available drop campaignsGET /api/campaigns/:id- Get detailed campaign informationGET /api/campaigns/:id/drops- Get all drops for a specific campaign
User Endpoints
GET /api/user/profile- Get authenticated user profileGET /api/user/inventory- Get user's claimed drops inventory
Settings Endpoints
GET /api/settings- Get current application settingsPUT /api/settings- Update application settings
Stream Endpoints
GET /api/streams/game/:gameId?limit=10- Get live streams for a specific gameGET /api/streams/current- Get currently watched stream
Example API Usage
# Check if miner is running and what it's doing
curl http://localhost:8080/api/miner/status
# Get real-time progress for all drops
curl http://localhost:8080/api/miner/progress
# Get currently active drop with live progress
curl http://localhost:8080/api/miner/current-drop
# Start drop mining
curl -X POST http://localhost:8080/api/miner/start
# Get all available campaigns
curl http://localhost:8080/api/campaigns/
WebSocket Events
Real-time updates are provided via WebSocket at /ws:
status_update: Miner status changesnotification: System notificationserror: Error messages
Development
Project Structure
The project follows the guidelines in CLAUDE.md:
/
├── main.go # Application entry point
├── internal/
│ ├── config/ # Configuration management
│ ├── twitch/ # Twitch API client
│ ├── drops/ # Drop mining logic
│ ├── storage/ # Database operations
│ └── web/ # Web server and handlers
├── web/static/ # Frontend assets
│ ├── html/ # HTML templates
│ ├── css/ # Stylesheets
│ └── js/ # JavaScript modules
└── CLAUDE.md # Development guidelines
Building
# Build for current platform
go build -o twitchdropsfarmer
# Build for Linux
GOOS=linux GOARCH=amd64 go build -o twitchdropsfarmer-linux
# Build for Windows
GOOS=windows GOARCH=amd64 go build -o twitchdropsfarmer.exe
# Build for macOS
GOOS=darwin GOARCH=amd64 go build -o twitchdropsfarmer-macos
Live Development
For development with auto-reload:
# Install air for live reloading
go install github.com/air-verse/air@latest
# Run with auto-reload
air
Running in Production
- Set
GIN_MODE=releasein your environment - Use a reverse proxy (nginx/Apache) for HTTPS
- Set up proper firewall rules
- Consider using a process manager like systemd
Technical Implementation
Drop Progress Tracking
This implementation uses the exact same approach as TwitchDropsMiner:
- Real-time Progress: Uses Twitch's
DropCurrentSessionContextGraphQL operation to get live progress data that matches exactly what appears on twitch.tv - Sequential Drop Logic: For multi-drop campaigns (e.g., 30min → 90min → 180min), automatically determines completion status of previous drops based on the currently active drop
- Accurate Channel Targeting: Uses the correct channel user ID (not stream ID) for GraphQL operations
Authentication
- Uses Twitch's OAuth Device Flow with Android app credentials (same as TDM)
- No need to create your own Twitch app
- Tokens are stored securely and refreshed automatically
Security Considerations
- OAuth tokens are stored securely in SQLite database
- CORS is configured for web interface
- No sensitive data is logged
- Uses HTTPS-ready configuration
Contributing
- Follow the architecture guidelines in
CLAUDE.md - Maintain compatibility with original TwitchDropsMiner logic
- Use Go best practices and error handling
- Test thoroughly before submitting PRs
License
This project maintains the same license as the original TwitchDropsMiner.
Acknowledgments
- DevilXD for the original TwitchDropsMiner
- Twitch for providing the API infrastructure
- The Go and web development communities
Disclaimer
This tool is for educational purposes. Use responsibly and in accordance with Twitch's Terms of Service.
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
