LAP-DEV commited on
Commit
0de4f47
·
verified ·
1 Parent(s): 59bb5d4

Update modules/utils/subtitle_manager.py

Browse files
Files changed (1) hide show
  1. modules/utils/subtitle_manager.py +7 -0
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"""