Filenames structured like the one provided are commonly used on third-party file-sharing or pirate sites (e.g., "movies4uvip").
def rename_file(filename): match = re.match(r'movies4uvipshogun(\d+)s(\d+)e(\d+)(\d+)(\d+)bit', filename) if match: year, season, episode, res, bit = match.groups() new_name = f"Shogun.Sseason.zfill(2)Eepisode.zfill(2).year.resp.bitbit.Wide.mp4" os.rename(filename, new_name) return new_name movies4uvipshogun2024s01e071080p10bitw new