Numbari - S01E01.mkv
pattern = r""" ^-?(?P<group>[A-Za-z0-9.]+)-?. # group (?P<show>[A-Za-z0-9.]+). # show name S(?P<season>\d+)P(?P<part>\d+). # season + part (?P<res>\d+p). # resolution (?P<codec>[A-Za-z0-9]+). # codec (?P<source>[A-Za-z0-9-]+) # source .(?P<ext>[a-z0-9]+)$ # extension """ --- -Xprime4u.Pro-.Numbari.S01P01.720p.HEVC.WeB-DL
This guide covers , renaming , metadata extraction , and automation for such naming conventions. 1. Understand the Pattern The filename contains several parts: Numbari - S01E01
Output:
python rename.py /path/to/files --dry python rename.py /path/to/files | Variation | Example | Fix | |-----------|---------|-----| | Missing group | Numbari.S01P01.720p.HEVC.WeB-DL.mkv | Make group optional | | Different extension | .mp4 , .avi | Allow in regex | | Plex wants E01 not P01 | S01P01 → S01E01 | Convert part to episode | | Two‑part episode | S01P01-P02 | Detect range or split | 7. Automation (Watch folder) Use inotify (Linux) or Watchdog (Python) to auto‑process new files. # season + part (
