Keep your Plex libraries in sync with your media files.
Scan your Plex media libraries for missing files and triggers rescans when needed.
This is a good once over in case your autoscan tool misses an import or an upgrade from your *arr
It can also provide Discord notification summaries.
- Scans specified directories for media files
- Checks if files exist in Plex libraries
- Triggers Plex rescans for missing items
- Sends Discord notifications with detailed summaries
- Supports both movie and TV show libraries
- Configurable scan intervals and behavior
- Docker support for easy deployment
- Python 3.11 or higher
- Plex Media Server
- Discord webhook URL (for notifications)
- Clone the repository:
git clone https://github.com/Pukabyte/rescan.git
cd rescan- Copy the example config:
cp config-example.ini config.ini- Edit
config.iniwith your settings:
[plex]
server = http://localhost:32400
token = your_plex_token_here
[scan]
directories = /path/to/your/media/folder
[behaviour]
scan_interval = 5
run_interval = 24
symlink_check = true
[notifications]
enabled = false
discord_webhook_url = your_discord_webhook_url_here- Run with Docker Compose:
docker-compose up -d- Clone the repository:
git clone https://github.com/Pukabyte/rescan.git
cd rescan- Install dependencies:
pip install -r requirements.txt- Copy and configure the config file:
cp config-example.ini config.ini-
Edit
config.iniwith your settings -
Run the script:
python rescan.pyserver: Your Plex server URL (e.g., http://localhost:32400)token: Your Plex authentication token
directories: Comma-separated list of directories to scanscan_interval: Seconds to wait between Plex rescansrun_interval: Hours between full scanssymlink_check: Enable/disable broken symlink detection
enabled: Enable/disable Discord notificationsdiscord_webhook_url: Your Discord webhook URL
The script sends detailed notifications to Discord including:
- Overview of missing items
- Library-specific statistics
- Broken symlinks (if enabled)
- Errors and warnings
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- PlexAPI for Plex server interaction
- Discord.py for Discord webhook support
