mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Fix for #8
This commit is contained in:
parent
ab28e5beaa
commit
20cdb64f54
3 changed files with 16 additions and 3 deletions
4
Makefile
4
Makefile
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION=1.2.1
|
VERSION=1.2.2
|
||||||
BINARY_NAME=crunchy
|
BINARY_NAME=crunchy
|
||||||
VERSION_BINARY_NAME=$(BINARY_NAME)-v$(VERSION)
|
VERSION_BINARY_NAME=$(BINARY_NAME)-v$(VERSION)
|
||||||
|
|
||||||
|
|
@ -11,7 +11,7 @@ build:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
install -Dm755 $(BINARY_NAME) $(DESTDIR)$(PREFIX)/bin/crunchyroll-go
|
install -Dm755 $(BINARY_NAME) $(DESTDIR)$(PREFIX)/bin/crunchyroll-go
|
||||||
cp $(DESTDIR)$(PREFIX)/bin/crunchyroll-go $(DESTDIR)$(PREFIX)/bin/crunchy
|
cp -f $(DESTDIR)$(PREFIX)/bin/crunchyroll-go $(DESTDIR)$(PREFIX)/bin/crunchy
|
||||||
install -Dm644 crunchyroll-go.1 $(DESTDIR)$(PREFIX)/share/man/man1/crunchyroll-go.1
|
install -Dm644 crunchyroll-go.1 $(DESTDIR)$(PREFIX)/share/man/man1/crunchyroll-go.1
|
||||||
install -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/licenses/crunchyroll-go/LICENSE
|
install -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/licenses/crunchyroll-go/LICENSE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ func init() {
|
||||||
getCmd.Flags().StringVarP(&outputFlag, "output", "o", "{title}.ts", "Name of the output file\n"+
|
getCmd.Flags().StringVarP(&outputFlag, "output", "o", "{title}.ts", "Name of the output file\n"+
|
||||||
"If you use the following things in the name, the will get replaced\n"+
|
"If you use the following things in the name, the will get replaced\n"+
|
||||||
"\t{title} » Title of the video\n"+
|
"\t{title} » Title of the video\n"+
|
||||||
|
"\t{series_name} » Name of the series\n"+
|
||||||
"\t{season_title} » Title of the season\n"+
|
"\t{season_title} » Title of the season\n"+
|
||||||
"\t{season_number} » Number of the season\n"+
|
"\t{season_number} » Number of the season\n"+
|
||||||
"\t{episode_number} » Number of the episode\n"+
|
"\t{episode_number} » Number of the episode\n"+
|
||||||
|
|
@ -210,8 +211,19 @@ func download(urls []string) {
|
||||||
switch value.Kind() {
|
switch value.Kind() {
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
valueAsString = value.String()
|
valueAsString = value.String()
|
||||||
|
case reflect.Int:
|
||||||
|
valueAsString = strconv.Itoa(int(value.Int()))
|
||||||
|
if len(valueAsString) == 1 {
|
||||||
|
valueAsString = "0" + valueAsString
|
||||||
|
}
|
||||||
case reflect.Float64:
|
case reflect.Float64:
|
||||||
valueAsString = strconv.Itoa(int(value.Float()))
|
valueAsString = strconv.FormatFloat(value.Float(), 'f', 2, 64)
|
||||||
|
case reflect.Bool:
|
||||||
|
if value.Bool() {
|
||||||
|
valueAsString = field.Tag.Get("json")
|
||||||
|
} else {
|
||||||
|
valueAsString = fmt.Sprintf("no %s", field.Tag.Get("json"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = strings.ReplaceAll(filename, "{"+field.Tag.Get("json")+"}", valueAsString)
|
filename = strings.ReplaceAll(filename, "{"+field.Tag.Get("json")+"}", valueAsString)
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ Downloads only the subtitles without the corresponding video.
|
||||||
\fB-o, --output OUTPUT\fR
|
\fB-o, --output OUTPUT\fR
|
||||||
Name of the output file. Formatting is also supported, so if the name contains one or more of the following things, they will get replaced.
|
Name of the output file. Formatting is also supported, so if the name contains one or more of the following things, they will get replaced.
|
||||||
{title} » Title of the video.
|
{title} » Title of the video.
|
||||||
|
{series_name} » Name of the series.
|
||||||
{season_title} » Title of the season.
|
{season_title} » Title of the season.
|
||||||
{season_number} » Number of the season.
|
{season_number} » Number of the season.
|
||||||
{episode_number} » Number of the episode.
|
{episode_number} » Number of the episode.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue