Version: 1.4.0 Last Updated: 2025-05-29
Scanly is a media file organization tool that helps scan, categorize, and organize your media library.
Scanly offers these key features:
- Media Organization: Scans directories for media files and organizes them using symlinks or hardlinks
- Metadata Integration: Uses TMDB API to fetch accurate metadata for TV shows and movies
- Content Type Detection: Uses scanner lists (like tv_series.txt, anime_movies.txt, etc.) to identify content types
- Library Structure: Creates an organized library structure with customizable folder naming
- Anime Separation: Optionally separates anime content into dedicated folders
- Resume Functionality: Tracks progress to resume interrupted scans
- Skipped Items Tracking: Keeps track of items that couldn't be processed
Scanly uses a comprehensive configuration system:
- Environment Variables: Loaded from .env file using
python-dotenv
- Command Line Arguments: For one-time overrides and specific operations
- Settings Management UI: An interactive menu to modify settings
- Scanner Lists: Text files in the scanners directory containing known TV series and movies with their IDs
- Directory Processor: Processes directories recursively to find media files
- File Processor: Extracts information from filenames (show name, season/episode)
- API Integration: Connects to TMDB for metadata
- Symlink/Hardlink Creator: Creates the organized library structure
The settings menu allows users to modify configuration through a text-based interface. It reads from and writes to the .env file, making changes persistent.
Scanly has Docker support with:
- Volume mounts for media directories
- Environment variable overrides
- An entrypoint script that manages configuration
The scanner lists (like tv_series.txt) contain entries in formats like:
Show Name [TMDB_ID]
Show Name [Error]
(when ID couldn't be determined)
These lists help identify TV shows and movies by name.
Scanly supports various command-line arguments:
--movie
: Process a specific movie directory--tv
: Process a specific TV show directory--force
: Force rescan of already processed files--config
: Use a specific configuration file--debug
: Enable debug logging--quiet
: Run in quiet mode
- Clone the repository:
git clone https://github.com/amcgready/scanly.git
cd scanly
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file based on the example:
cp .env.template .env
- Edit the
.env
file and set your TMDB API key and other settings.
- Clone the repository:
git clone https://github.com/amcgready/scanly.git
cd scanly
- Create a
.env
file for Docker:
cp .env.example .env
-
Edit the
.env
file to set your TMDB API key and (optionally) other settings. -
Set environment variables for your media directories:
export DESTINATION_DIRECTORY=/path/to/your/library
- Build and run the Docker container:
docker-compose up -d
- Clone the repository:
git clone https://github.com/amcgready/Scanly.git
cd Scanly
- Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
- Configure your environment:
cp .env.template .env
# Edit .env with your preferred text editor and add your TMDB API key
- Launch Scanly:
python src/main.py
For detailed installation instructions, see INSTALL.md.
Run Scanly from the project directory:
python src/main.py
To use Scanly in interactive mode with Docker:
docker-compose exec -it scanly python src/main.py
To process a specific path inside the container:
docker-compose exec scanly python src/main.py --movie /media/source/movies
# or
docker-compose exec scanly python src/main.py --tv /media/source/tv_shows
To view the logs:
docker-compose logs -f scanly
When running Scanly on Synology NAS, you may encounter permission issues. Follow these steps for a successful setup:
- Use the Synology Docker UI to create the container
- Set the correct PUID and PGID values:
- Run
id
in the Synology terminal to get your user's UID and GID - Set these values as environment variables in the Docker UI
- Run
- Mount volumes properly:
- For media source:
/volume1/path/to/your/media:/media/source:ro
- For destination library:
/volume1/path/to/your/library:/media/library
- For media source:
- Set the DESTINATION_DIRECTORY environment variable to
/media/library
Alternatively, create a .env
file in your Scanly directory with:
PUID=1026 # Replace with your actual user ID
PGID=100 # Replace with your actual group ID
MEDIA_SOURCE_DIR=/volume1/path/to/your/media
MEDIA_LIBRARY_DIR=/volume1/path/to/your/library
Then run with:
docker-compose -f simple-compose.yml up -d
Scanly can be configured using the .env
file. Here's a complete list of all available configuration options:
TMDB_API_KEY
: Your TMDB API key (required)TMDB_BASE_URL
: Base URL for TMDB API (default: https://api.themoviedb.org/3)MDBLIST_API_KEY
: API key for MDBList integration
DESTINATION_DIRECTORY
: Destination directory for the organized library
LINK_TYPE
: Type of links to create - 'symlink' or 'hardlink' (default: symlink)RELATIVE_SYMLINK
: Use relative paths for symlinks (true/false)
CUSTOM_SHOW_FOLDER
: Custom name for TV shows folder (default: "TV Shows")CUSTOM_4KSHOW_FOLDER
: Custom name for 4K TV shows folderCUSTOM_ANIME_SHOW_FOLDER
: Custom name for anime shows folder (default: "Anime Shows")CUSTOM_MOVIE_FOLDER
: Custom name for movies folder (default: "Movies")CUSTOM_4KMOVIE_FOLDER
: Custom name for 4K movies folderCUSTOM_ANIME_MOVIE_FOLDER
: Custom name for anime movies folder (default: "Anime Movies")
SHOW_RESOLUTION_STRUCTURE
: Enable organization by resolution for TV shows (true/false)MOVIE_RESOLUTION_STRUCTURE
: Enable organization by resolution for movies (true/false)
SHOW_RESOLUTION_FOLDER_REMUX_4K
: Folder name for 4K remux showsSHOW_RESOLUTION_FOLDER_REMUX_1080P
: Folder name for 1080p remux showsSHOW_RESOLUTION_FOLDER_REMUX_DEFAULT
: Folder name for other remux showsSHOW_RESOLUTION_FOLDER_2160P
: Folder name for 2160p showsSHOW_RESOLUTION_FOLDER_1080P
: Folder name for 1080p showsSHOW_RESOLUTION_FOLDER_720P
: Folder name for 720p showsSHOW_RESOLUTION_FOLDER_480P
: Folder name for 480p showsSHOW_RESOLUTION_FOLDER_DVD
: Folder name for DVD showsSHOW_RESOLUTION_FOLDER_DEFAULT
: Default folder for shows with unrecognized resolution
MOVIE_RESOLUTION_FOLDER_REMUX_4K
: Folder name for 4K remux moviesMOVIE_RESOLUTION_FOLDER_REMUX_1080P
: Folder name for 1080p remux moviesMOVIE_RESOLUTION_FOLDER_REMUX_DEFAULT
: Folder name for other remux moviesMOVIE_RESOLUTION_FOLDER_2160P
: Folder name for 2160p moviesMOVIE_RESOLUTION_FOLDER_1080P
: Folder name for 1080p moviesMOVIE_RESOLUTION_FOLDER_720P
: Folder name for 720p moviesMOVIE_RESOLUTION_FOLDER_480P
: Folder name for 480p moviesMOVIE_RESOLUTION_FOLDER_DVD
: Folder name for DVD moviesMOVIE_RESOLUTION_FOLDER_DEFAULT
: Default folder for movies with unrecognized resolution
ANIME_SCAN
: Enable scanning for anime content (true/false)ANIME_SEPARATION
: Separate anime into its own folder structure (true/false)
SCANNER_ENABLED
: Enable scanner functionality (true/false)SCANNER_PRIORITY
: Prioritize scanner results over other metadata sources (true/false)
TMDB_FOLDER_ID
: Include TMDB ID in folder names (true/false)IMDB_FOLDER_ID
: Include IMDB ID in folder names (true/false)TVDB_FOLDER_ID
: Include TVDB ID in folder names (true/false)
RENAME_ENABLED
: Enable file renaming (true/false)RENAME_TAGS
: Custom tags to include in renamed files
MAX_PROCESSES
: Maximum number of concurrent processesALLOWED_EXTENSIONS
: Comma-separated list of file extensions to process (e.g., .mp4,.mkv,.srt)SKIP_ADULT_PATTERNS
: Skip files that match adult content patterns (true/false)SKIP_EXTRAS_FOLDER
: Skip processing "extras" folders (true/false)EXTRAS_MAX_SIZE_MB
: Maximum size in MB for files in extras folders
RCLONE_MOUNT
: Enable Rclone mount integration (true/false)MOUNT_CHECK_INTERVAL
: Interval in seconds to check mount status
SLEEP_TIME
: Time to sleep between monitoring iterations in secondsSYMLINK_CLEANUP_INTERVAL
: Interval in seconds for cleaning up broken symlinks
ENABLE_PLEX_UPDATE
: Enable Plex library updates (true/false)PLEX_URL
: URL for your Plex server (e.g., http://localhost:32400)PLEX_TOKEN
: Authentication token for your Plex server
DB_THROTTLE_RATE
: Database operation throttling rateDB_MAX_RETRIES
: Maximum number of retries for database operationsDB_RETRY_DELAY
: Delay in seconds between database operation retriesDB_BATCH_SIZE
: Size of batches for database operationsDB_MAX_WORKERS
: Maximum number of database worker threads
LOG_LEVEL
: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)LOG_FILE
: Path to log file
AUTO_EXTRACT_EPISODES
: Automatically extract episode numbers without prompting (true/false)PROGRESS_FILE
: Path to the progress tracking file (default: scanly_progress.json)
When using Docker, you can set these additional environment variables either in the .env
file or in docker-compose.yml
:
MEDIA_SOURCE_DIR
: Host path to your media files (read-only mount)MEDIA_LIBRARY_DIR
: Host path where the organized library will be created
Scanly supports several command line arguments:
# Process a specific movie directory
python src/main.py --movie /path/to/movies
# Process a specific TV show directory
python src/main.py --tv /path/to/tv_shows
# Force rescan of already processed files
python src/main.py --force
# Use a specific configuration file
python src/main.py --config /path/to/custom.env
# Enable debug logging
python src/main.py --debug
# Run in quiet mode (less output)
python src/main.py --quiet
# Show help
python src/main.py --help
Scanly can be run entirely via the command line:
- Activate your virtual environment (if you created one):
source venv/bin/activate # On Windows: venv\Scripts\activate
- Run the main script directly:
python src/main.py
- Follow the interactive prompts to scan and organize your media.
You can also use command line arguments for specific operations:
# Scan a specific movie directory
python src/main.py --movie /path/to/movies
# Scan a specific TV show directory
python src/main.py --tv /path/to/tv_shows
# Start in interactive menu mode
python src/main.py --interactive
# Force rescan of previously processed files
python src/main.py --force
# See all available options
python src/main.py --help
The CLI mode is particularly useful for:
- Server environments without a GUI
- Automation via cron jobs or scripts
- Quick scans of specific directories
- Users who prefer terminal-based workflows