Spaces:
Running
Running
jhj0517
commited on
Commit
·
0c6f6c3
1
Parent(s):
0036278
Add `read_file()`
Browse files
modules/utils/files_manager.py
CHANGED
@@ -67,3 +67,9 @@ def is_video(file_path):
|
|
67 |
video_extensions = ['.mp4', '.mkv', '.avi', '.mov', '.flv', '.wmv', '.webm', '.m4v', '.mpeg', '.mpg', '.3gp']
|
68 |
extension = os.path.splitext(file_path)[1].lower()
|
69 |
return extension in video_extensions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
video_extensions = ['.mp4', '.mkv', '.avi', '.mov', '.flv', '.wmv', '.webm', '.m4v', '.mpeg', '.mpg', '.3gp']
|
68 |
extension = os.path.splitext(file_path)[1].lower()
|
69 |
return extension in video_extensions
|
70 |
+
|
71 |
+
|
72 |
+
def read_file(file_path):
|
73 |
+
with open(file_path, "r", encoding="utf-8") as f:
|
74 |
+
subtitle_content = f.read()
|
75 |
+
return subtitle_content
|