import re def clean_movie_title(filename): # Remove the starting ID and common tags raw_title = filename.split('-')[-3] + " " + filename.split('-')[-2] year = filename.split('-')[-1] # Humanize the title clean_name = raw_title.replace("RETURNOFTHELIVINGDEAD", "Return of the Living Dead").title() clean_name = clean_name.replace(" 2", " Part II") return f"{clean_name} ({year})" # Example Usage file_string = "14143-BR1080p-SUBS-RETURNOFTHELIVINGDEAD-2-1988" print(f"Original: {file_string}") print(f"Cleaned: {clean_movie_title(file_string)}") Use code with caution. Copied to clipboard Why this is useful:
To turn that messy file string into a "useful feature," you can create a that automatically extracts metadata from raw release names. This is especially helpful for media servers or personal library organization. The "Clean Title" Feature 14143-BR1080p-SUBS-RETURNOFTHELIVINGDEAD-2-1988...
It strips out technical junk (like "BR1080p") so you can search for just the film title. The "Clean Title" Feature It strips out technical
It makes the film instantly recognizable in a file explorer or media player. 14143-BR1080p-SUBS-RETURNOFTHELIVINGDEAD-2-1988...