(save_path='output')
| 52 | os.rename(os.path.join(save_path, file), os.path.join(save_path, new_filename + ext)) |
| 53 | |
| 54 | def find_video_files(save_path='output'): |
| 55 | video_files = [file for file in glob.glob(save_path + "/*") if os.path.splitext(file)[1][1:].lower() in load_key("allowed_video_formats")] |
| 56 | # change \\ to /, this happen on windows |
| 57 | if sys.platform.startswith('win'): |
| 58 | video_files = [file.replace("\\", "/") for file in video_files] |
| 59 | video_files = [file for file in video_files if not file.startswith("output/output")] |
| 60 | if len(video_files) != 1: |
| 61 | raise ValueError(f"Number of videos found {len(video_files)} is not unique. Please check.") |
| 62 | return video_files[0] |
| 63 | |
| 64 | if __name__ == '__main__': |
| 65 | # Example usage |
no test coverage detected