csukuangfj commited on
Commit
b825d1e
1 Parent(s): 06b4245

small fixes

Browse files
Files changed (1) hide show
  1. decode.py +3 -3
decode.py CHANGED
@@ -36,9 +36,9 @@ class Segment:
36
  return self.start + self.duration
37
 
38
  def __str__(self):
39
- s = f"{timedelta(seconds=self.start)}"[:-3]
40
  s += " --> "
41
- s += f"{timedelta(seconds=self.end)}"[:-3]
42
  s = s.replace(".", ",")
43
  s += "\n"
44
  s += self.text
@@ -114,4 +114,4 @@ def decode(
114
  seg.text = stream.result.text.strip()
115
  segment_list.append(seg)
116
 
117
- return "\n\n".join(f"{i}\n{seg} " for i, seg in enumerate(segment_list, 1))
 
36
  return self.start + self.duration
37
 
38
  def __str__(self):
39
+ s = f"0{timedelta(seconds=self.start)}"[:-3]
40
  s += " --> "
41
+ s += f"0{timedelta(seconds=self.end)}"[:-3]
42
  s = s.replace(".", ",")
43
  s += "\n"
44
  s += self.text
 
114
  seg.text = stream.result.text.strip()
115
  segment_list.append(seg)
116
 
117
+ return "\n\n".join(f"{i}\n{seg}" for i, seg in enumerate(segment_list, 1))