A Python bot that automatically downloads images and videos from Discord channels to your Synology NAS using Download Station.
- 🤖 Automatic Detection: Monitors specified Discord channels for new messages containing images and videos
- 📥 Smart Downloads: Automatically downloads media files to your Synology NAS via Download Station
- 🎯 Multiple Sources: Supports Discord attachments and common media hosting sites (YouTube, Imgur, etc.)
- 📂 Organized Storage: Creates organized folder structure based on channel names
- ✅ Visual Feedback: Reacts to messages with emojis to indicate download status
- 🔧 Configurable: Easy configuration via environment variables
- Python 3.8+
- Discord bot token
- Synology NAS with Download Station enabled
- Network access between the bot and your NAS
-
Clone the repository:
git clone https://github.com/RAMOTS/discord-showcase-loader.git cd discord-showcase-loader -
Install dependencies:
pip install -r requirements.txt
-
Create configuration file:
cp .env.example .env
-
Edit the
.envfile with your settings (see Configuration section below)
Copy .env.example to .env and configure the following variables:
DISCORD_BOT_TOKEN: Your Discord bot token (required)DISCORD_CHANNEL_IDS: Comma-separated list of channel IDs to monitor (required)
SYNOLOGY_HOST: IP address or hostname of your NAS (required)SYNOLOGY_PORT: Port for DSM (default: 5000 for HTTP, 5001 for HTTPS)SYNOLOGY_USERNAME: NAS username (required)SYNOLOGY_PASSWORD: NAS password (required)SYNOLOGY_USE_HTTPS: Use HTTPS connection (default: false)
DOWNLOAD_DESTINATION: Destination folder on NAS (default: downloads/discord-media)
# Discord Bot Configuration
DISCORD_BOT_TOKEN=your_discord_bot_token_here
DISCORD_CHANNEL_IDS=123456789012345678,987654321098765432
# Synology NAS Configuration
SYNOLOGY_HOST=192.168.1.100
SYNOLOGY_PORT=5000
SYNOLOGY_USERNAME=your_nas_username
SYNOLOGY_PASSWORD=your_nas_password
SYNOLOGY_USE_HTTPS=false
# Download Configuration
DOWNLOAD_DESTINATION=downloads/discord-media-
Create a Discord Application:
- Go to Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" section
- Click "Add Bot"
- Copy the bot token
-
Configure Bot Permissions:
- In the OAuth2 → URL Generator section
- Select "bot" scope
- Select these permissions:
- Read Messages/View Channels
- Read Message History
- Add Reactions
-
Invite Bot to Server:
- Use the generated URL to invite the bot to your Discord server
- Make sure the bot has access to the channels you want to monitor
-
Get Channel IDs:
- Enable Developer Mode in Discord (User Settings → Advanced → Developer Mode)
- Right-click on channels you want to monitor
- Click "Copy ID"
-
Enable Download Station:
- Open DSM on your Synology NAS
- Go to Package Center
- Install "Download Station" if not already installed
- Open Download Station and ensure it's running
-
Create Download Folders:
- The bot will automatically create subfolders based on channel names
- Ensure the NAS user has write permissions to the destination folder
-
Network Access:
- Ensure the bot can reach your NAS on the network
- If using Docker, make sure networking is configured properly
python discord_showcase_loader.pyThe bot automatically detects and downloads:
Images: .jpg, .jpeg, .png, .gif, .bmp, .webp, .svg, .tiff, .ico
Videos: .mp4, .avi, .mov, .wmv, .flv, .webm, .mkv, .m4v, .3gp, .ogv
Supported Sites:
- Discord attachments
- Direct media file URLs
- YouTube
- Vimeo
- Imgur
- Twitch
- Reddit media
The bot will react to messages with emojis:
- ✅ Download queued successfully
- ❌ Download failed
⚠️ Error occurred during processing
Downloaded files are organized as follows:
downloads/discord-media/
├── channel-name-1/
│ ├── 20231201_143022_channel-name-1_username_image.jpg
│ └── 20231201_143105_channel-name-1_username_video.mp4
└── channel-name-2/
└── 20231201_144530_channel-name-2_username_meme.gif
-
Bot not responding:
- Check bot token is correct
- Ensure bot has proper permissions in Discord
- Verify channel IDs are correct
-
NAS connection failed:
- Check NAS IP address and port
- Verify username/password
- Ensure Download Station is running
- Check firewall settings
-
Downloads not starting:
- Verify Download Station is enabled
- Check destination folder permissions
- Look at bot logs for error messages
The bot creates a log file discord_showcase_loader.log with detailed information about:
- Bot startup and configuration
- Message processing
- Download attempts
- Errors and warnings
To test the setup:
- Start the bot
- Post an image or video in a monitored channel
- Check for emoji reaction on the message
- Verify download appears in Download Station
- Check log file for any errors
discord-showcase-loader/
├── discord_showcase_loader.py # Main bot script
├── synology_client.py # Synology API client
├── config.py # Configuration management
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
└── README.md # This file
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source. Feel free to modify and distribute according to your needs.
Contributions are welcome! Please feel free to submit issues and pull requests.
If you encounter issues:
- Check the troubleshooting section
- Review the log files
- Open an issue on GitHub with detailed information