@@ -10,14 +10,20 @@ This is a go library and command-line tools for handling .srt, .vtt and .ssa sub
10
10
11
11
Windows and macOS binaries are available under [ Releases] ( https://github.com/martinlindhe/subtitles/releases )
12
12
13
- Or install them from source :
13
+ Or install them directly from git :
14
14
15
15
```
16
16
go get -u github.com/martinlindhe/subtitles/...
17
17
```
18
18
19
19
20
- # Example - convert srt to vtt
20
+
21
+ # Sub-projects
22
+
23
+ - [ subber] ( https://github.com/martinlindhe/subtitles/tree/master/cmd/subber ) command line tool for subtitles
24
+
25
+
26
+ # Library example - convert srt to vtt
21
27
22
28
``` go
23
29
import " github.com/martinlindhe/subtitles"
@@ -29,7 +35,6 @@ in := "1\n" +
29
35
" 1\n " +
30
36
" 00:01:09,630 --> 00:01:11,005\n " +
31
37
" No ninja!\n "
32
-
33
38
res , _ := subtitles.NewFromSRT (in)
34
39
35
40
// Output: WEBVTT
@@ -43,25 +48,17 @@ fmt.Println(res.AsVTT())
43
48
```
44
49
45
50
46
- # Example - download subtitle from thesubdb.com
51
+ # Library example - download subtitles
47
52
48
53
``` go
49
54
f , _ := os.Open (fileName)
50
55
defer f.Close ()
51
56
52
57
finder := subtitles.NewSubFinder (f, fileName, " en" )
53
-
54
58
text , err := finder.TheSubDb ()
55
59
```
56
60
57
61
58
- # Sub-projects
59
-
60
- - [ subber] ( https://github.com/martinlindhe/subtitles/tree/master/cmd/subber ) command line tool for subtitles
61
- - [ ssa2srt] ( https://github.com/martinlindhe/subtitles/tree/master/cmd/ssa2srt ) for converting .ssa to .srt
62
- - [ dcsub2srt] ( https://github.com/martinlindhe/subtitles/tree/master/cmd/dcsub2srt ) for converting dcsubtitles to .srt
63
-
64
-
65
62
# License
66
63
67
64
Under [ MIT] ( LICENSE )
0 commit comments