Skip to content

Commit

Permalink
fix: no longer able to unpack segment
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Jan 25, 2025
1 parent 8a52521 commit 10db8c8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions capgen/transcriber/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def to_srt(self) -> Iterator[str]:
"""
return (
f'{id}\n'
f'{self.convert_seconds_to_hhmmssmmm(start, ",")} --> '
f'{self.convert_seconds_to_hhmmssmmm(end, ",")}\n{text[1:]}'
for id, _, start, end, text, *_ in self.segments
f'{self.convert_seconds_to_hhmmssmmm(segment.start, ",")} --> '
f'{self.convert_seconds_to_hhmmssmmm(segment.end, ",")}\n{segment.text[1:]}'
for segment in self.segments
)

def to_vtt(self) -> Iterator[str]:
Expand All @@ -87,7 +87,7 @@ def to_vtt(self) -> Iterator[str]:
"""
yield 'WEBVTT'
yield from (
f'{self.convert_seconds_to_hhmmssmmm(start, ".")} --> '
f'{self.convert_seconds_to_hhmmssmmm(end, ".")}\n{text[1:]}'
for _, _, start, end, text, *_ in self.segments
f'{self.convert_seconds_to_hhmmssmmm(segment.start, ".")} --> '
f'{self.convert_seconds_to_hhmmssmmm(segment.end, ".")}\n{segment.text[1:]}'
for segment in self.segments
)

0 comments on commit 10db8c8

Please sign in to comment.