MCPcopy
hub / github.com/Huanshere/VideoLingo / find_video_files

Function find_video_files

core/_1_ytdlp.py:54–62  ·  view source on GitHub ↗
(save_path='output')

Source from the content-addressed store, hash-verified

52 os.rename(os.path.join(save_path, file), os.path.join(save_path, new_filename + ext))
53
54def 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
64if __name__ == '__main__':
65 # Example usage

Callers 7

transcribeFunction · 0.90
merge_video_audioFunction · 0.90
merge_subtitles_to_videoFunction · 0.90
cleanupFunction · 0.90
download_video_sectionFunction · 0.90
_1_ytdlp.pyFile · 0.85

Calls 1

load_keyFunction · 0.85

Tested by

no test coverage detected