Download - Woh.bhi.din.the.2024.720p.hevc.web-... -
@staticmethod def move_to_folder(src_path: Path, dest_root: Path, meta: MediaMetadata) -> Path: # Example folder: /Movies/Woh Bhi Din The (2024)/Woh Bhi Din The (2024) [720p HEVC WEB].mkv movie_folder = dest_root / f"meta.title (meta.year)" if meta.year else dest_root / meta.title movie_folder.mkdir(parents=True, exist_ok=True) new_name = FileOrganizer.generate_clean_name(meta) dest_path = movie_folder / new_name shutil.move(str(src_path), str(dest_path)) return dest_path if name == " main ": sample = "Woh.Bhi.Din.The.2024.720p.HEVC.WeB-NoGrp.mkv" parsed = MediaParser.parse(sample) print(parsed) # Output: # MediaMetadata(raw_name='Woh.Bhi.Din.The.2024.720p.HEVC.WeB-NoGrp.mkv', # title='Woh Bhi Din The', year=2024, resolution='720P', # codec='HEVC', source='WEB', group='NoGrp', extension='mkv')
meta = 'raw_name': filename, 'title': base, 'year': None, 'resolution': None, 'codec': None, 'source': None, 'group': None, 'extension': ext Download - Woh.Bhi.Din.The.2024.720p.HEVC.WeB-...
It looks like you're referencing a filename pattern for a movie download ( Woh.Bhi.Din.The.2024.720p.HEVC.Web-... ), and you'd like me to around it. @staticmethod def move_to_folder(src_path: Path
@classmethod def parse(cls, filename: str) -> MediaMetadata: base = Path(filename).stem ext = Path(filename).suffix.lstrip('.') meta: MediaMetadata) ->
# Extract release group group_match = re.search(cls.PATTERNS['group'], base) if group_match: meta['group'] = group_match.group('group')
# Extract source src_match = re.search(cls.PATTERNS['source'], base, re.IGNORECASE) if src_match: meta['source'] = src_match.group().upper()