# Common scene tags to strip tags_to_strip = [ r'\.c1nem4\.', r'\.c1nema\.', r'\.proper\.', r'\.repack\.', r'\.internal\.', r'\.real\.', r'\.rerip\.', r'\.nzb\.' ] for tag in tags_to_strip: name = re.sub(tag, '.', name, flags=re.I)

# Remove group name at end (e.g., -SUNSCREEN, -RARBG) name = re.sub(r'\-[A-Z0-9]+$', '', name)

# Detect codec codec = None if re.search(r'\.x264\.', name, re.I): codec = 'H.264' elif re.search(r'\.x265\.', name, re.I): codec = 'H.265'

# Extract year year_match = re.search(r'\b(19|20)\d2\b', clean_name) year = year_match.group(0) if year_match else None

return "original": raw_filename, "clean_title": clean_name, "year": year, "source": source_detected, "codec": codec, "low_quality_warning": is_low_quality, "suggested_plex_name": plex_name

The.substance.2024.hdcam.c1nem4.x264-sunscreen-... 【FULL | CHEAT SHEET】

# Common scene tags to strip tags_to_strip = [ r'\.c1nem4\.', r'\.c1nema\.', r'\.proper\.', r'\.repack\.', r'\.internal\.', r'\.real\.', r'\.rerip\.', r'\.nzb\.' ] for tag in tags_to_strip: name = re.sub(tag, '.', name, flags=re.I)

# Remove group name at end (e.g., -SUNSCREEN, -RARBG) name = re.sub(r'\-[A-Z0-9]+$', '', name) The.Substance.2024.HDCAM.c1nem4.x264-SUNSCREEN-...

# Detect codec codec = None if re.search(r'\.x264\.', name, re.I): codec = 'H.264' elif re.search(r'\.x265\.', name, re.I): codec = 'H.265' # Common scene tags to strip tags_to_strip = [ r'\

# Extract year year_match = re.search(r'\b(19|20)\d2\b', clean_name) year = year_match.group(0) if year_match else None -RARBG) name = re.sub(r'\-[A-Z0-9]+$'

return "original": raw_filename, "clean_title": clean_name, "year": year, "source": source_detected, "codec": codec, "low_quality_warning": is_low_quality, "suggested_plex_name": plex_name