mirror of
https://github.com/Dasemu/Transcriptarr.git
synced 2026-11-27 23:46:08 +00:00
Fix for LRC putting newlines inappropriately
This commit is contained in:
1 parent
49231e0d11
commit
d28ff6a170
1 file changed
+3
-1
@@ -632,7 +632,9 @@ def write_lrc(result, file_path):
|
||||
for segment in result.segments:
|
||||
minutes, seconds = divmod(int(segment.start), 60)
|
||||
fraction = int((segment.start - int(segment.start)) * 100)
|
||||
file.write(f"[{minutes:02d}:{seconds:02d}.{fraction:02d}] {segment.text}\n")
|
||||
# remove embedded newlines in text, since some players ignore text after newlines
|
||||
text = segment.text[:].replace('\n', '')
|
||||
file.write(f"[{minutes:02d}:{seconds:02d}.{fraction:02d}]{text}\n")
|
||||
|
||||
def gen_subtitles(file_path: str, transcription_type: str, force_language : LanguageCode = LanguageCode.NONE) -> None:
|
||||
"""Generates subtitles for a video file.
|
||||
|
||||
Reference in new issue
Block a user