From 798bafc21bcde5ec61aaee879b39430d5cc30645 Mon Sep 17 00:00:00 2001 From: Valentin ROCHE Date: Thu, 14 Apr 2022 14:12:02 +0200 Subject: [PATCH] Cleaning repo, linting --- .gitignore | 5 -- .travis.yml | 15 ------ README.md | 39 +--------------- astisub/main.go | 114 ---------------------------------------------- go.mod | 20 +++++--- go.sum | 29 +++++------- srt_test.go | 2 +- ssa.go | 49 +------------------- ssa_test.go | 2 +- stl.go | 51 ++++++++------------- stl_test.go | 2 +- subtitles.go | 8 ++-- subtitles_test.go | 2 +- teletext.go | 7 +-- ttml_test.go | 4 +- webvtt.go | 1 - webvtt_test.go | 2 +- 17 files changed, 57 insertions(+), 295 deletions(-) delete mode 100644 .gitignore delete mode 100644 .travis.yml delete mode 100644 astisub/main.go diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5be2b41..0000000 --- a/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -Thumbs.db -.idea/ -cover* -test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 05ca03d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go -go: -- 1.x -- tip -install: -- go get -t ./... -- go get golang.org/x/tools/cmd/cover -- go get github.com/mattn/goveralls -- go install github.com/mattn/goveralls -matrix: - allow_failures: - - go: tip -script: -- go test -race -v -coverprofile=coverage.out -- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci \ No newline at end of file diff --git a/README.md b/README.md index 43e7bd6..2e33733 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,3 @@ -[![GoReportCard](http://goreportcard.com/badge/github.com/asticode/go-astisub)](http://goreportcard.com/report/github.com/asticode/go-astisub) -[![GoDoc](https://godoc.org/github.com/asticode/go-astisub?status.svg)](https://godoc.org/github.com/asticode/go-astisub) -[![Travis](https://travis-ci.com/asticode/go-astisub.svg?branch=master)](https://travis-ci.com/asticode/go-astisub#) -[![Coveralls](https://coveralls.io/repos/github/asticode/go-astisub/badge.svg?branch=master)](https://coveralls.io/github/asticode/go-astisub) - This is a Golang library to manipulate subtitles. It allows you to manipulate `srt`, `stl`, `ttml`, `ssa/ass`, `webvtt` and `teletext` files for now. @@ -13,11 +8,7 @@ Available operations are `parsing`, `writing`, `syncing`, `fragmenting`, `unfrag To install the library: - go get github.com/asticode/go-astisub - -To install the CLI: - - go install github.com/asticode/go-astisub/astisub + go get github.com/molotovtv/go-astisub # Using the library in your code @@ -49,34 +40,6 @@ var buf = &bytes.Buffer{} s2.WriteToTTML(buf) ``` -# Using the CLI - -If **astisub** has been installed properly you can: - -- convert any type of subtitle to any other type of subtitle: - - astisub convert -i example.srt -o example.ttml - -- fragment any type of subtitle: - - astisub fragment -i example.srt -f 2s -o example.out.srt - -- merge any type of subtitle into any other type of subtitle: - - astisub merge -i example.srt -i example.ttml -o example.out.srt - -- optimize any type of subtitle: - - astisub optimize -i example.srt -o example.out.srt - -- unfragment any type of subtitle: - - astisub unfragment -i example.srt -o example.out.srt - -- sync any type of subtitle: - - astisub sync -i example.srt -s "-2s" -o example.out.srt - # Features and roadmap - [x] parsing diff --git a/astisub/main.go b/astisub/main.go deleted file mode 100644 index 51bc823..0000000 --- a/astisub/main.go +++ /dev/null @@ -1,114 +0,0 @@ -package main - -import ( - "flag" - "log" - - "github.com/asticode/go-astikit" - "github.com/asticode/go-astisub" -) - -// Flags -var ( - fragmentDuration = flag.Duration("f", 0, "the fragment duration") - inputPath = astikit.NewFlagStrings() - teletextPage = flag.Int("p", 0, "the teletext page") - outputPath = flag.String("o", "", "the output path") - syncDuration = flag.Duration("s", 0, "the sync duration") -) - -func main() { - // Init - cmd := astikit.FlagCmd() - flag.Var(&inputPath, "i", "the input paths") - flag.Parse() - - // Validate input path - if len(*inputPath.Slice) == 0 { - log.Fatal("Use -i to provide at least one input path") - } - - // Validate output path - if len(*outputPath) <= 0 { - log.Fatal("Use -o to provide an output path") - } - - // Open first input path - var sub *astisub.Subtitles - var err error - if sub, err = astisub.Open(astisub.Options{Filename: (*inputPath.Slice)[0], Teletext: astisub.TeletextOptions{Page: *teletextPage}}); err != nil { - log.Fatalf("%s while opening %s", err, (*inputPath.Slice)[0]) - } - - // Switch on subcommand - switch cmd { - case "convert": - // Write - if err = sub.Write(*outputPath); err != nil { - log.Fatalf("%s while writing to %s", err, *outputPath) - } - case "fragment": - // Validate fragment duration - if *fragmentDuration <= 0 { - log.Fatal("Use -f to provide a fragment duration") - } - - // Fragment - sub.Fragment(*fragmentDuration) - - // Write - if err = sub.Write(*outputPath); err != nil { - log.Fatalf("%s while writing to %s", err, *outputPath) - } - case "merge": - // Validate second input path - if len(*inputPath.Slice) == 1 { - log.Fatal("Use -i to provide at least two input paths") - } - - // Open second input path - var sub2 *astisub.Subtitles - if sub2, err = astisub.Open(astisub.Options{Filename: (*inputPath.Slice)[1], Teletext: astisub.TeletextOptions{Page: *teletextPage}}); err != nil { - log.Fatalf("%s while opening %s", err, (*inputPath.Slice)[1]) - } - - // Merge - sub.Merge(sub2) - - // Write - if err = sub.Write(*outputPath); err != nil { - log.Fatalf("%s while writing to %s", err, *outputPath) - } - case "optimize": - // Optimize - sub.Optimize() - - // Write - if err = sub.Write(*outputPath); err != nil { - log.Fatalf("%s while writing to %s", err, *outputPath) - } - case "sync": - // Validate sync duration - if *syncDuration == 0 { - log.Fatal("Use -s to provide a sync duration") - } - - // Fragment - sub.Add(*syncDuration) - - // Write - if err = sub.Write(*outputPath); err != nil { - log.Fatalf("%s while writing to %s", err, *outputPath) - } - case "unfragment": - // Unfragment - sub.Unfragment() - - // Write - if err = sub.Write(*outputPath); err != nil { - log.Fatalf("%s while writing to %s", err, *outputPath) - } - default: - log.Fatalf("Invalid subcommand %s", cmd) - } -} diff --git a/go.mod b/go.mod index f50c273..c3c881c 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,17 @@ -module github.com/asticode/go-astisub +module github.com/molotovtv/go-astisub -go 1.13 +go 1.18 require ( - github.com/asticode/go-astikit v0.20.0 - github.com/asticode/go-astits v1.8.0 - github.com/stretchr/testify v1.4.0 - golang.org/x/net v0.0.0-20200904194848-62affa334b73 - golang.org/x/text v0.3.2 + github.com/asticode/go-astikit v0.29.1 + github.com/asticode/go-astits v1.10.0 + github.com/stretchr/testify v1.7.1 + golang.org/x/net v0.0.0-20220412020605-290c469a71a5 + golang.org/x/text v0.3.7 +) + +require ( + github.com/davecgh/go-spew v1.1.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index dea5cec..753336c 100644 --- a/go.sum +++ b/go.sum @@ -1,28 +1,23 @@ -github.com/asticode/go-astikit v0.20.0 h1:+7N+J4E4lWx2QOkRdOf6DafWJMv6O4RRfgClwQokrH8= github.com/asticode/go-astikit v0.20.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0= -github.com/asticode/go-astits v1.8.0 h1:rf6aiiGn/QhlFjNON1n5plqF3Fs025XLUwiQ0NB6oZg= -github.com/asticode/go-astits v1.8.0/go.mod h1:DkOWmBNQpnr9mv24KfZjq4JawCFX1FCqjLVGvO0DygQ= +github.com/asticode/go-astikit v0.29.1 h1:w27sLYXK84mDwArf/Vw1BiD5dfD5PBDB+iHoIcpYq0w= +github.com/asticode/go-astikit v0.29.1/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0= +github.com/asticode/go-astits v1.10.0 h1:ixKsRl84nWtjgHWcWKTDkUHNQ4kxbf9nKmjuSCninCU= +github.com/asticode/go-astits v1.10.0/go.mod h1:DkOWmBNQpnr9mv24KfZjq4JawCFX1FCqjLVGvO0DygQ= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/srt_test.go b/srt_test.go index 24cb656..e1e040b 100644 --- a/srt_test.go +++ b/srt_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/asticode/go-astisub" + "github.com/molotovtv/go-astisub" "github.com/stretchr/testify/assert" ) diff --git a/ssa.go b/ssa.go index a3a00b0..c2bb942 100644 --- a/ssa.go +++ b/ssa.go @@ -4,7 +4,6 @@ import ( "bufio" "fmt" "io" - "log" "regexp" "sort" "strconv" @@ -18,36 +17,9 @@ import ( // http://moodub.free.fr/video/ass-specs.doc // https://en.wikipedia.org/wiki/SubStation_Alpha -// SSA alignment -const ( - ssaAlignmentCentered = 2 - ssaAlignmentLeft = 1 - ssaAlignmentLeftJustifiedTopTitle = 5 - ssaAlignmentMidTitle = 8 - ssaAlignmentRight = 3 - ssaAlignmentTopTitle = 4 -) - -// SSA border styles -const ( - ssaBorderStyleOpaqueBox = 3 - ssaBorderStyleOutlineAndDropShadow = 1 -) - -// SSA collisions -const ( - ssaCollisionsNormal = "Normal" - ssaCollisionsReverse = "Reverse" -) - // SSA event categories const ( - ssaEventCategoryCommand = "Command" - ssaEventCategoryComment = "Comment" ssaEventCategoryDialogue = "Dialogue" - ssaEventCategoryMovie = "Movie" - ssaEventCategoryPicture = "Picture" - ssaEventCategorySound = "Sound" ) // SSA event format names @@ -121,20 +93,12 @@ const ( ssaStyleFormatNameUnderline = "Underline" ) -// SSA wrap style -const ( - ssaWrapStyleEndOfLineWordWrapping = "1" - ssaWrapStyleNoWordWrapping = "2" - ssaWrapStyleSmartWrapping = "0" - ssaWrapStyleSmartWrappingWithLowerLinesGettingWider = "3" -) - // SSA regexp var ssaRegexpEffect = regexp.MustCompile(`\{[^\{]+\}`) // ReadFromSSA parses an .ssa content func ReadFromSSA(i io.Reader) (o *Subtitles, err error) { - o, err = ReadFromSSAWithOptions(i, defaultSSAOptions()) + o, err = ReadFromSSAWithOptions(i, SSAOptions{}) return o, err } @@ -1284,14 +1248,3 @@ type SSAOptions struct { OnUnknownSectionName func(name string) OnInvalidLine func(line string) } - -func defaultSSAOptions() SSAOptions { - return SSAOptions{ - OnUnknownSectionName: func(name string) { - log.Printf("astisub: unknown section: %s", name) - }, - OnInvalidLine: func(line string) { - log.Printf("astisub: not understood: '%s', ignoring", line) - }, - } -} diff --git a/ssa_test.go b/ssa_test.go index 1807e18..9a457d1 100644 --- a/ssa_test.go +++ b/ssa_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/asticode/go-astikit" - "github.com/asticode/go-astisub" + "github.com/molotovtv/go-astisub" "github.com/stretchr/testify/assert" ) diff --git a/stl.go b/stl.go index 81a5d59..73d3d4d 100644 --- a/stl.go +++ b/stl.go @@ -26,11 +26,7 @@ const ( // STL character code table number const ( - stlCharacterCodeTableNumberLatin uint16 = 12336 - stlCharacterCodeTableNumberLatinCyrillic uint16 = 12337 - stlCharacterCodeTableNumberLatinArabic uint16 = 12338 - stlCharacterCodeTableNumberLatinGreek uint16 = 12339 - stlCharacterCodeTableNumberLatinHebrew uint16 = 12340 + stlCharacterCodeTableNumberLatin uint16 = 12336 ) // STL character code tables @@ -93,33 +89,22 @@ var ( // STL code page numbers const ( - stlCodePageNumberCanadaFrench uint32 = 3683891 stlCodePageNumberMultilingual uint32 = 3683632 - stlCodePageNumberNordic uint32 = 3683893 - stlCodePageNumberPortugal uint32 = 3683888 - stlCodePageNumberUnitedStates uint32 = 3420983 ) // STL comment flag const ( - stlCommentFlagTextContainsSubtitleData = '\x00' - stlCommentFlagTextContainsCommentsNotIntendedForTransmission = '\x01' + stlCommentFlagTextContainsSubtitleData = '\x00' ) // STL country codes const ( - stlCountryCodeChinese = "CHN" - stlCountryCodeFrance = "FRA" - stlCountryCodeJapan = "JPN" - stlCountryCodeNorway = "NOR" + stlCountryCodeFrance = "FRA" ) // STL cumulative status const ( - stlCumulativeStatusFirstSubtitleOfACumulativeSet = '\x01' - stlCumulativeStatusIntermediateSubtitleOfACumulativeSet = '\x02' - stlCumulativeStatusLastSubtitleOfACumulativeSet = '\x03' - stlCumulativeStatusSubtitleNotPartOfACumulativeSet = '\x00' + stlCumulativeStatusSubtitleNotPartOfACumulativeSet = '\x00' ) // STL display standard code @@ -136,10 +121,7 @@ var stlFramerateMapping = astikit.NewBiMap(). // STL justification code const ( - stlJustificationCodeCentredText = '\x02' - stlJustificationCodeLeftJustifiedText = '\x01' - stlJustificationCodeRightJustifiedText = '\x03' - stlJustificationCodeUnchangedPresentation = '\x00' + stlJustificationCodeLeftJustifiedText = '\x01' ) // STL language codes @@ -161,8 +143,7 @@ var stlLanguageMapping = astikit.NewBiMap(). // STL timecode status const ( - stlTimecodeStatusNotIntendedForUse = "0" - stlTimecodeStatusIntendedForUse = "1" + stlTimecodeStatusIntendedForUse = "1" ) // TTI Special Extension Block Number @@ -569,29 +550,33 @@ func (b gsiBlock) bytes() (o []byte) { // parseDurationSTL parses a STL duration func parseDurationSTL(i string, framerate int) (d time.Duration, err error) { // Parse hours - var hours, hoursString = 0, i[0:2] - if hours, err = strconv.Atoi(hoursString); err != nil { + var hoursString = i[0:2] + hours, err := strconv.Atoi(hoursString) + if err != nil { err = fmt.Errorf("astisub: atoi of %s failed: %w", hoursString, err) return } // Parse minutes - var minutes, minutesString = 0, i[2:4] - if minutes, err = strconv.Atoi(minutesString); err != nil { + var minutesString = i[2:4] + minutes, err := strconv.Atoi(minutesString) + if err != nil { err = fmt.Errorf("astisub: atoi of %s failed: %w", minutesString, err) return } // Parse seconds - var seconds, secondsString = 0, i[4:6] - if seconds, err = strconv.Atoi(secondsString); err != nil { + var secondsString = i[4:6] + seconds, err := strconv.Atoi(secondsString) + if err != nil { err = fmt.Errorf("astisub: atoi of %s failed: %w", secondsString, err) return } // Parse frames - var frames, framesString = 0, i[6:8] - if frames, err = strconv.Atoi(framesString); err != nil { + var framesString = i[6:8] + frames, err := strconv.Atoi(framesString) + if err != nil { err = fmt.Errorf("astisub: atoi of %s failed: %w", framesString, err) return } diff --git a/stl_test.go b/stl_test.go index f46d2bd..e47b643 100644 --- a/stl_test.go +++ b/stl_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/asticode/go-astikit" - "github.com/asticode/go-astisub" + "github.com/molotovtv/go-astisub" "github.com/stretchr/testify/assert" ) diff --git a/subtitles.go b/subtitles.go index 5534dc5..70d444a 100644 --- a/subtitles.go +++ b/subtitles.go @@ -458,10 +458,10 @@ func (s *Subtitles) Fragment(f time.Duration) { *newSub = *sub // We compare the timings in milliseconds, because it is their output time format (VID-409) - subStartAtMs := sub.StartAt / time.Millisecond - fragmentStartAtMs := fragmentStartAt / time.Millisecond - subEndAtMs := sub.EndAt / time.Millisecond - fragmentEndAtMs := fragmentEndAt / time.Millisecond + subStartAtMs := sub.StartAt.Milliseconds() + fragmentStartAtMs := fragmentStartAt.Milliseconds() + subEndAtMs := sub.EndAt.Milliseconds() + fragmentEndAtMs := fragmentEndAt.Milliseconds() // A switch is more readable here switch { diff --git a/subtitles_test.go b/subtitles_test.go index cc94441..35c6beb 100644 --- a/subtitles_test.go +++ b/subtitles_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/asticode/go-astisub" + "github.com/molotovtv/go-astisub" "github.com/stretchr/testify/assert" ) diff --git a/teletext.go b/teletext.go index 3223f77..03378c1 100644 --- a/teletext.go +++ b/teletext.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "io" - "log" "math/bits" "sort" "strings" @@ -316,9 +315,7 @@ func teletextPESDataType(dataIdentifier uint8) string { // Teletext PES data unit ids const ( - teletextPESDataUnitIDEBUNonSubtitleData = 0x2 - teletextPESDataUnitIDEBUSubtitleData = 0x3 - teletextPESDataUnitIDStuffing = 0xff + teletextPESDataUnitIDEBUSubtitleData = 0x3 ) // TeletextOptions represents teletext options @@ -458,7 +455,6 @@ func teletextPID(dmx *astits.Demuxer, o TeletextOptions) (pid uint16, err error) // Set pid pid = pids[0] - log.Printf("astisub: no teletext pid specified, using pid %d", pid) // Rewind if _, err = dmx.Rewind(); err != nil { @@ -633,7 +629,6 @@ func (b *teletextPageBuffer) parsePacketHeader(i []byte, magazineNumber uint8, t if subtitleFlag { b.magazineNumber = magazineNumber b.pageNumber = pageNumber - log.Printf("astisub: no teletext page specified, using page %d%.2d", b.magazineNumber, b.pageNumber) } } diff --git a/ttml_test.go b/ttml_test.go index 990c821..ece3eb0 100644 --- a/ttml_test.go +++ b/ttml_test.go @@ -2,11 +2,11 @@ package astisub_test import ( "bytes" - "github.com/asticode/go-astikit" "io/ioutil" "testing" - "github.com/asticode/go-astisub" + "github.com/asticode/go-astikit" + "github.com/molotovtv/go-astisub" "github.com/stretchr/testify/assert" ) diff --git a/webvtt.go b/webvtt.go index c186d49..87963bb 100644 --- a/webvtt.go +++ b/webvtt.go @@ -20,7 +20,6 @@ import ( // Constants const ( webvttBlockNameComment = "comment" - webvttBlockNameRegion = "region" webvttBlockNameStyle = "style" webvttBlockNameText = "text" webvttTimeBoundariesSeparator = " --> " diff --git a/webvtt_test.go b/webvtt_test.go index d37b093..dbf536d 100644 --- a/webvtt_test.go +++ b/webvtt_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/asticode/go-astisub" + "github.com/molotovtv/go-astisub" "github.com/stretchr/testify/assert" )