Professional Discord bot for automated video processing, magnet link downloading, and Google Drive integration. Built with modern Python technologies and designed for content creators and video enthusiasts.
Developed by [LeonisDev0](https://github.com/LeonisDev0 Discord: leonis1337 ) π
python bot.py
- Magnet Link Downloader - Fast torrent downloading using Aria2c with progress tracking
- Video Encoder - Professional video processing with FFmpeg (intro + video + subtitle merging)
- Google Drive Uploader - Automated cloud storage integration with OAuth2
- Discord Bot Interface - Modern slash command system with rich embeds
- Progress Tracking - Real-time operation monitoring with visual progress bars
- Statistics System - Comprehensive bot analytics and performance metrics
- Multi-threaded Processing - Concurrent download, encode, and upload operations
- Resumable Operations - Interrupted processes can be resumed automatically
- Advanced Error Handling - Robust error management and recovery systems
- Comprehensive Logging - Detailed operation logs with file rotation
- Resource Management - CPU, memory, and disk usage optimization
- Cross-platform Support - Windows, Linux, and macOS compatibility
discord.py>=2.3.0
PyNaCl>=1.5.0
google-api-python-client>=2.70.0
google-auth-httplib2>=0.1.0
google-auth-oauthlib>=0.8.0
psutil>=5.9.0
requests>=2.28.0
urllib3>=1.26.0
certifi>=2022.0.0
six>=1.16.0
packaging>=21.0
git clone [repository-url]
cd Encoder-Bot-main
pip install -r requirements.txt
- Windows: Download from FFmpeg.org
- Extract to
C:\ffmpeg\bin\
or add to system PATH
- Extract to
- Linux:
sudo apt install ffmpeg
- macOS:
brew install ffmpeg
- Windows: Download from Aria2 GitHub
- Extract to
C:\aria2\
or add to system PATH
- Extract to
- Linux:
sudo apt install aria2
- macOS:
brew install aria2
- Go to Discord Developer Portal
- Create new application
- Navigate to Bot section
- Copy bot token
- Enable required permissions:
- Send Messages
- Use Slash Commands
- Attach Files
- Read Message History
- Embed Links
- Visit Google Cloud Console
- Create new project or select existing
- Enable Google Drive API
- Create OAuth 2.0 credentials
- Download
credentials.json
to project root
Create bot_token.txt
in project root:
YOUR_DISCORD_BOT_TOKEN_HERE
/indir magnet_link:MAGNET_LINK filename:VIDEO_NAME
Downloads video from magnet link with custom filename.
Example:
/indir magnet_link:magnet:?xt=urn:btih:... filename:my_video
/encode intro:intro.mp4 episode:video.mkv subtitle_file:subtitle.ass subtitle_name:sub.ass
Combines intro, main video, and subtitle into single MP4 file.
Example:
/encode intro:intro.mp4 episode:episode01.mkv subtitle_file:subtitle.ass subtitle_name:sub.ass
/upload video_name:encoded_video.mp4
Uploads processed video from encode/
folder to Google Drive.
Shows active downloads and files in downloads folder.
Displays active encoding processes and statistics.
Shows active uploads and Google Drive status.
Encoder-Bot-main/
βββ bot.py # Main Discord bot with slash commands
βββ encoder.py # Video processing engine (FFmpeg)
βββ downloader.py # Magnet link downloader (Aria2c)
βββ uploader.py # Google Drive integration
βββ stats.py # Statistics and analytics system
βββ requirements.txt # Python dependencies
βββ bot_token.txt # Discord bot token
βββ credentials.json # Google Drive API credentials
βββ downloads/ # Downloaded files
βββ encode/ # Encoded videos
βββ uploads/ # Files ready for upload
βββ temp/ # Temporary files
βββ logs/ # Operation logs
βββ encodelog/ # Encoding process logs
βββ subs/ # Subtitle files (temporary)
FFMPEG_PATH=/usr/bin/ffmpeg
ARIA2C_PATH=/usr/bin/aria2c
DOWNLOAD_DIR=downloads
ENCODE_DIR=encode
UPLOAD_DIR=uploads
- Max Concurrent Downloads: 3 (configurable in
downloader.py
) - Max Concurrent Encodes: 3 (configurable in
encoder.py
) - Max File Size: 5GB (configurable in
uploader.py
) - Log Level: INFO (configurable in logging setup)
- Max Connections: 16 per server
- Split Size: 8 segments
- Min Split: 1MB
- Max Peers: 50
- Seed Time: 0 (no seeding)
- Active downloads and encodes
- System resource usage
- Operation success rates
- Performance metrics
- Daily/weekly/monthly statistics
logs/bot_*.log
- Bot operation logs with timestampsencodelog/encode_*.log
- Individual encoding process logs- Console output with colored log levels
- Automatic log rotation
- Visual progress bars for all operations
- Real-time speed and ETA information
- Status updates via Discord embeds
- Error reporting and recovery
- Download Speed: Adjust Aria2c parameters in
downloader.py
- Encoding Quality: Modify FFmpeg parameters in
encoder.py
- Memory Usage: Limit concurrent operations in respective modules
- Disk Space: Monitor temporary file cleanup
- Check
logs/
directory for error details - Review encoding logs in
encodelog/
- Monitor console output for real-time issues
- Use Discord command responses for status
- CPU: 20-80% during encoding
- Memory: 100MB-2GB depending on video size
- Disk: Temporary storage for processing files
- Network: Optimized for high-bandwidth operations
- v2.0: Enhanced error handling and logging
- v1.5: Google Drive integration improvements
- v1.0: Initial release with core functionality
- Web-based control panel
- Multiple video format support
- Advanced subtitle handling
- Cloud storage alternatives
- API rate limit optimization
- Docker containerization
git clone [repository-url] cd Discord-Encoder-Bot
pip install -r requirements.txt
python bot.py
## π Support
**(Discord: Leonis1337 )**
**Developed by [LeonisDev0](https://github.com/LeonisDev0)**
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.