The Dark Knight Trilogy 1080p Bdrip Aac X264-to... Apr 2026

new_name = clean_filename(match) new_path = filepath.with_name(new_name)

def get_media_info(filepath): """Use ffprobe to get actual codec, bitrate, and audio channels.""" cmd = [ 'ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_streams', '-show_format', str(filepath) ] try: result = subprocess.run(cmd, capture_output=True, text=True, check=True) return result.stdout except (subprocess.SubprocessError, FileNotFoundError): return None THE DARK KNIGHT TRILOGY 1080p BDRip AAC x264-to...

#!/usr/bin/env python3 """ Media File Organizer for files named like: "The Dark Knight Trilogy 1080p BDRip AAC x264-to..." Parses scene naming, renames to clean format, checks bitrate, and verifies audio. """ import re import os import sys import subprocess from pathlib import Path Example input: "The Dark Knight Trilogy 1080p BDRip AAC x264-to..." PATTERN = re.compile( r'^(?P<title>.+?)\s+' # Title (lazy match) r'(?P<resolution>\d3,4p)\s+' # 720p, 1080p, 2160p r'(?P<source>BDRip|WEB-DL|BluRay)\s+' # Source r'(?P<audio>AAC|DTS|AC3)\s+' # Audio codec r'(?P<video>x264|x265|AV1)\s*' # Video codec r' -– ?' # Release group (optional) r'(?P<ext>.mkv|.mp4|.avi)$' # Extension ) new_name = clean_filename(match) new_path = filepath

print(f"\nFound: filepath.name") print(f" → new_name") str(filepath) ] try: result = subprocess.run(cmd

The Dark Knight Trilogy 1080p BDRip AAC x264-toxx.mkv The Dark Knight 2008 1080p BDRip DTS x264-toxx.mkv

match = PATTERN.search(filepath.name) if not match: print(f"Skipping (no match): filepath.name") continue