You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This lines produces 2 errors.
The first is fixed by replacing the dots in the timestamps with commas. s2, _ := astisub.ReadFromSRT(bytes.NewReader([]byte("00:01:00,000 --> 00:02:00,000\nCredits")))
The second is because the input string begins with the timestamp.
Starting at line 53 in str.go:
If I use dots, it returns an error: astisub: line 2: parsing srt duration 00:01:00.000 failed: astisub: atoi of 00.000 failed: strconv.Atoi: parsing "00.000": invalid syntax
s2, _ := astisub.ReadFromSRT(bytes.NewReader([]byte("00:01:00.000 --> 00:02:00.000\nCredits")))
This lines produces 2 errors.
The first is fixed by replacing the dots in the timestamps with commas.
s2, _ := astisub.ReadFromSRT(bytes.NewReader([]byte("00:01:00,000 --> 00:02:00,000\nCredits")))
The second is because the input string begins with the timestamp.
Starting at line 53 in str.go:
https://github.com/asticode/go-astisub/blob/b6b18718ddb6ee0da08772d8ab310c9c3d2d0459/srt.go#L52C3-L58
Appending a line to the input []byte avoids the error.
s2, _ := astisub.ReadFromSRT(bytes.NewReader([]byte("1\n00:01:00,000 --> 00:02:00,000\nCredits")))
The text was updated successfully, but these errors were encountered: