File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ builds:
1111 binary : gst
1212archives :
1313 - id : " gst"
14+ format : tar.gz
15+ format_overrides :
16+ - goos : windows
17+ format : zip
1418 files :
1519 - LICENSE
1620 - README.md
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/luispater/gemini-srt-translator-go
33go 1.24.0
44
55require (
6- github.com/luispater/matroska-go v1.0.0
6+ github.com/luispater/matroska-go v1.2.2
77 github.com/openai/openai-go v1.12.0
88 github.com/spf13/cobra v1.9.1
99 golang.org/x/term v0.33.0
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aN
3030github.com/gorilla/websocket v1.5.3 /go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE =
3131github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8 =
3232github.com/inconshreveable/mousetrap v1.1.0 /go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw =
33- github.com/luispater/matroska-go v1.0.0 h1:JBoOtio6VU/EqirOm+7u1oIxIeSdi7QbY0hEtZj+2+I =
34- github.com/luispater/matroska-go v1.0.0 /go.mod h1:giucksajGO4MmrvlxwVci72/l/EdirWUI+ZZHt9ixHo =
33+ github.com/luispater/matroska-go v1.2.2 h1:AhXA5r+L4fSgyU89bIzXb7TorEYYsSt8R7NS2FkD1Ko =
34+ github.com/luispater/matroska-go v1.2.2 /go.mod h1:giucksajGO4MmrvlxwVci72/l/EdirWUI+ZZHt9ixHo =
3535github.com/openai/openai-go v1.12.0 h1:NBQCnXzqOTv5wsgNC36PrFEiskGfO5wccfCWDo9S1U0 =
3636github.com/openai/openai-go v1.12.0 /go.mod h1:g461MYGXEXBVdV5SaR/5tNzNbSfwTBBefwc+LlDCK0Y =
3737github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package video
33import (
44 "bufio"
55 "fmt"
6+ "io"
67 "os"
78 "path/filepath"
89 "strings"
@@ -127,7 +128,7 @@ func (p *MKVParser) extractSubtitlePackets(demuxer *matroska.Demuxer) error {
127128 for {
128129 packet , err := demuxer .ReadPacket ()
129130 if err != nil {
130- if strings .Contains (err .Error (), "EOF" ) {
131+ if err == io . EOF || strings .Contains (err .Error (), "EOF" ) {
131132 break // End of file reached
132133 }
133134 return fmt .Errorf ("failed to read packet: %w" , err )
@@ -146,8 +147,10 @@ func (p *MKVParser) extractSubtitlePackets(demuxer *matroska.Demuxer) error {
146147 }
147148
148149 // Calculate timing using the file's timecode scale
149- startTime := time .Duration (packet .StartTime ) * time .Duration (p .timecodescale )
150- endTime := time .Duration (packet .EndTime ) * time .Duration (p .timecodescale )
150+ // startTime := time.Duration(packet.StartTime) * time.Duration(p.timecodescale)
151+ // endTime := time.Duration(packet.EndTime) * time.Duration(p.timecodescale)
152+ startTime := time .Duration (packet .StartTime )
153+ endTime := time .Duration (packet .EndTime )
151154
152155 // Create subtitle entry
153156 entry := SubtitleEntry {
You can’t perform that action at this time.
0 commit comments