Skip to content

Pukabyte/rescan

Repository files navigation

GitHub Repo stars Issues License Contributors Discord

Keep your Plex libraries in sync with your media files.

Rescan

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.

rescan

Features

  • 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

Prerequisites

  • Python 3.11 or higher
  • Plex Media Server
  • Discord webhook URL (for notifications)

Installation

Docker (Recommended)

  1. Clone the repository:
git clone https://github.com/Pukabyte/rescan.git
cd rescan
  1. Copy the example config:
cp config-example.ini config.ini
  1. Edit config.ini with 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
  1. Run with Docker Compose:
docker-compose up -d

Manual Installation

  1. Clone the repository:
git clone https://github.com/Pukabyte/rescan.git
cd rescan
  1. Install dependencies:
pip install -r requirements.txt
  1. Copy and configure the config file:
cp config-example.ini config.ini
  1. Edit config.ini with your settings

  2. Run the script:

python rescan.py

Configuration

Plex Settings

Scan Settings

  • directories: Comma-separated list of directories to scan
  • scan_interval: Seconds to wait between Plex rescans
  • run_interval: Hours between full scans
  • symlink_check: Enable/disable broken symlink detection

Notification Settings

  • enabled: Enable/disable Discord notifications
  • discord_webhook_url: Your Discord webhook URL

Discord Notifications

The script sends detailed notifications to Discord including:

  • Overview of missing items
  • Library-specific statistics
  • Broken symlinks (if enabled)
  • Errors and warnings

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

Rescan missing media in plex without having to scan the whole library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published