Update modules/utils/subtitle_manager.py
Browse files
modules/utils/subtitle_manager.py
CHANGED
|
@@ -88,6 +88,13 @@ def get_txt(segments):
|
|
| 88 |
output += f"{timeformat_txt(segment['start'])}\t{segment['text']}\n"
|
| 89 |
return output
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
def parse_srt(file_path):
|
| 93 |
"""Reads SRT file and returns as dict"""
|
|
|
|
| 88 |
output += f"{timeformat_txt(segment['start'])}\t{segment['text']}\n"
|
| 89 |
return output
|
| 90 |
|
| 91 |
+
def get_plaintext(segments):
|
| 92 |
+
output = ""
|
| 93 |
+
for i, segment in enumerate(segments):
|
| 94 |
+
if segment['text'].startswith(' '):
|
| 95 |
+
segment['text'] = segment['text'][1:]
|
| 96 |
+
output += f"{segment['text']}\n"
|
| 97 |
+
return output
|
| 98 |
|
| 99 |
def parse_srt(file_path):
|
| 100 |
"""Reads SRT file and returns as dict"""
|