txt2vtt

Transformer la transcription sortie par peertube en vtt - retour accueil

git clone git://bebou.netlib.re/txt2vtt

Log | Files | Refs |

commit f69487e6aec23a1b2da264a9b047704ea7640258
parent 71d2b857bc720be8b5560313a482290bc6b62034
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Tue, 14 Jan 2025 17:53:24 +0100

Fix les timestamp

pour que ça fasse

1 --> 2
2 --> 3

et plus

1 --> 2
3 --> 4

Diffstat:
Mtxt2vtt | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/txt2vtt b/txt2vtt @@ -1,13 +1,17 @@ #! /bin/sh awk ' - BEGIN { printf("WEBVTT\n\n") } + BEGIN { + old="0:00" + printf("WEBVTT\n\n") + } { match($0,"[0-9]+:[0-9]+") - printf("%s.000 --> ",substr($0,1,RLENGTH)) + printf("%s.000 --> ",old) text=substr($0,RLENGTH+1) getline match($0,"[0-9]+:[0-9]+") - printf("%s.000\n%s\n\n",substr($0,1,RLENGTH),text) + old=substr($0,1,RLENGTH) + printf("%s.000\n%s\n\n",old,text) } '