Skip to content

Commit

Permalink
small changes to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gan-of-culture committed Nov 17, 2021
1 parent 11e131a commit b9ab78b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ For most of the sites the captions (CC, OC or Subtitles) are hard encoded into t

To see if the caption will be downloaded into an extra file you can look at your data's information with the option ```-i```. You'll see extra information if the option ```-c``` can be used:
```console
get-sauce -i "https://hentai-moon.com/videos/285/isekai-harem-monogatari-ep-1/"
get-sauce -i https://hentai-moon.com/videos/285/isekai-harem-monogatari-ep-1/

Site: https://hentai-moon.com
Title: Isekai Harem Monogatari - Ep.1
Expand Down
2 changes: 1 addition & 1 deletion downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (downloader *downloaderStruct) Download(data *static.Data) error {
}

// download captions
if len(data.Captions) > config.Caption {
if len(data.Captions) > config.Caption && config.Caption > -1 {
fileURI = filepath.Join(downloader.filePath, fmt.Sprintf("%s_caption_%s.%s", data.Title, data.Captions[config.Caption].Language, data.Captions[config.Caption].URL.Ext))
downloader.save(data.Captions[config.Caption].URL, fileURI)
}
Expand Down
6 changes: 6 additions & 0 deletions downloader/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"sort"
"strconv"

"github.com/gan-of-culture/get-sauce/config"
"github.com/gan-of-culture/get-sauce/static"
)

Expand Down Expand Up @@ -81,6 +82,11 @@ func printInfo(data *static.Data) {
func printStreamInfo(data *static.Data, streamKey string) {
printHeader(data)

if len(data.Captions) > config.Caption && config.Caption > -1 {
fmt.Println("\n Caption: ")
printCaption(config.Caption, data.Captions[config.Caption])
}

fmt.Println("\n Stream: ")
printStream(streamKey, data.Streams[streamKey])
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func init() {
flag.IntVar(&config.Amount, "a", 0, "Amount of files to download")
flag.IntVar(&config.Caption, "c", 0, "Download caption if separate to a extra file")
flag.IntVar(&config.Caption, "c", -1, "Download caption if separate to a extra file")
flag.StringVar(&config.OutputName, "o", "", "Output name")
flag.StringVar(&config.OutputPath, "O", "", "Output path (include ending slash)")
flag.StringVar(&config.Pages, "p", "", "Enter pages like 1,2,3-4,6,7,8-9 for doujins")
Expand Down

0 comments on commit b9ab78b

Please sign in to comment.