if not dry_run: # Rename file filepath.rename(new_path) # Verify integrity if verify_integrity(new_path): print(" ✓ Integrity check passed") else: print(" ✗ WARNING: File may be corrupted")
# Show actual codec info info = get_media_info(new_path) if info: # Extract video bitrate, audio channels (simplified) if 'video' in info and 'bit_rate' in info: print(" ✓ Media info extracted") else: print(" (dry run, no changes made)") if == " main ": if len(sys.argv) < 2: print(f"Usage: sys.argv[0] /path/to/movies [--do-it]") sys.exit(1) THE DARK KNIGHT TRILOGY 1080p BDRip AAC x264-to...
The Dark Knight Trilogy (1080p).mkv The Dark Knight 2008 (1080p).mkv And it will alert you if any file is incomplete or corrupted. if not dry_run: # Rename file filepath
match = PATTERN.search(filepath.name) if not match: print(f"Skipping (no match): filepath.name") continue dry_run=True): """Scan directory
def organize_directory(directory, dry_run=True): """Scan directory, rename files, and verify.""" directory = Path(directory) for filepath in directory.iterdir(): if filepath.suffix.lower() not in ['.mkv', '.mp4', '.avi']: continue
new_name = clean_filename(match) new_path = filepath.with_name(new_name)