From b9ab78b8284c5b9a8c31899b12d942b1868496f0 Mon Sep 17 00:00:00 2001 From: gan-of-culture Date: Wed, 17 Nov 2021 17:54:28 +0100 Subject: [PATCH] small changes to readme --- README.md | 2 +- downloader/downloader.go | 2 +- downloader/utils.go | 6 ++++++ main.go | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fda2e97..f996691 100755 --- a/README.md +++ b/README.md @@ -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 diff --git a/downloader/downloader.go b/downloader/downloader.go index eeb4d29..a1329dd 100755 --- a/downloader/downloader.go +++ b/downloader/downloader.go @@ -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) } diff --git a/downloader/utils.go b/downloader/utils.go index 08a2782..57f24bf 100755 --- a/downloader/utils.go +++ b/downloader/utils.go @@ -5,6 +5,7 @@ import ( "sort" "strconv" + "github.com/gan-of-culture/get-sauce/config" "github.com/gan-of-culture/get-sauce/static" ) @@ -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]) } diff --git a/main.go b/main.go index d0394cc..12850c2 100755 --- a/main.go +++ b/main.go @@ -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")