def t1(i): if i > 0: path = 'E:/multimedia/video' all_files = list_files(path) old_files = name_filter(all_files, r'\[Kaicn&Kisssub\]\[To_Love_Ru\]' \ r'\d\d\[BIG5\]\[868×480\](流畅).f4v') new_files = generate_new_names(old_files, r'(\d+)', 1, \ '出包王女01_', 2, 0, '.f4v') print(old_files, new_files) if i > 1: old_path_names = join_path_basenames(path, old_files) new_path_names = join_path_basenames(path, new_files) print(old_path_names, new_path_names) if i > 2: rename_to(old_path_names, new_path_names)
def t4(n): if n > 0: path = 'E:/temp_output/video' all_files = list_files(path) old_files = name_filter(all_files, r'只有神知道的世界II.*\d+.*(清晰)\.f4v') new_files = generate_new_names(old_files, r'(\d+)', 1, \ '只有神知道的世界02_', 2, 0, '(清晰).f4v') #print(old_files, new_files) for idx, old, new in zip(range(len(old_files)), old_files, new_files): print(idx, old, new) if n > 1: old_path_names = join_path_basenames(path, old_files) new_path_names = join_path_basenames(path, new_files) #print(old_path_names, new_path_names) for idx, old, new in zip(range(len(old_files)), \ old_path_names, \ new_path_names): print(idx, old, new) if n > 2: rename_to(old_path_names, new_path_names)
def t2(n): if n > 0: path = 'E:/multimedia/video' all_files = list_files(path) old_files = name_filter(all_files, r'出包王女.*\d\d\(流畅)\.f4v') new_files = generate_new_names(old_files, r'(\d+)', 1, \ '出包王女02_', 2, 0, '.f4v') #print(old_files, new_files) for idx, old, new in zip(range(len(old_files)), old_files, new_files): print(idx, old, new) if n > 1: old_path_names = join_path_basenames(path, old_files) new_path_names = join_path_basenames(path, new_files) #print(old_path_names, new_path_names) for idx, old, new in zip(range(len(old_files)), \ old_path_names, \ new_path_names): print(idx, old, new) if n > 2: rename_to(old_path_names, new_path_names)