A suite of professional, highly robust Python utility scripts designed to automate, flatten, deduplicate, and organize large media libraries (specifically on network storage shares like TrueNAS).
- Intelligent Sorting (
sort_media.py): Organizes loose media files/folders into a destination directory based on existing performer folders (prefixed with#--) or studio/category folders. Optionally creates folders for recurring items. - Recursive Flattening & Cleanup (
flatten_cleanup.py): Removes all non-video files recursively, flattens subdirectories under performer and studio folders, preserves source context for generically named files, and cleans up empty folders. - Strict Deduplication (
deduplicate_exact.py): Finds duplicate files of identical byte size, ranks copies (keeping performer folders over studio, and studio overzzMisc), and safely deletes duplicates. - Quality-Based Deduplication (
deduplicate_qualities.py): Finds duplicate scenes of different qualities (e.g. 1080p vs 2160p), prioritizes keeping1080pcopies, and cleans up the rest. - Folder-Level Deduplication (
deduplicate_folders.py): Scans parent directories to group duplicate scene folders by matching site/date name, ranks folder resolutions (preferring1080pover2160p/4K, then720p), and deletes redundant folders recursively.
Each script is designed as an independent CLI with standard inputs.
python sort_media.py --source "<source_path>" --dest "<dest_path>" [--create-folders] [--dry-run]python flatten_cleanup.py --dir "<abe_directory_path>" [--dry-run]python deduplicate_exact.py --dir "<abe_directory_path>" [--dry-run]python deduplicate_qualities.py --dir "<abe_directory_path>" [--dry-run]python deduplicate_folders.py --dir "<adult_review_directory_path>" [--dry-run]- Python 3.x
- Supported on Windows / Win32 (includes automatic
\\?\UNC\long-path support to bypass the 260-characterMAX_PATHlimit).