Skip to content

Commit

Permalink
update dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ggdream committed Oct 30, 2020
1 parent 3e48f7e commit 8c992e7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ python bilibili.py <BV_Number> # 注意bilibili.py的路径
[分支地址](https://github.com/ggdream/bilibili/tree/golang)
~~~sh
$ go get https://github.com/ggdream/bilibili # 会自动编译成二进制文件到$GOBIN下
$ down <BV_Number> # 其他功能使用($down --help)查看帮助
$ bilibili <BV_Number> # 其他功能使用($down --help)查看帮助
~~~

# Docker
Expand Down
48 changes: 23 additions & 25 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,39 @@ package main

import (
"fmt"
"github.com/ggdream/down/core"
"github.com/ggdream/bilibili/core"
"github.com/urfave/cli/v2"
"os"
)



var (
name = "down"
version = "1.0.0"
usage = "$ down [-a, [-c, [-d]]] <bv>"
name = "down"
version = "1.0.0"
usage = "$ down [-a, [-c, [-d]]] <bv>"

all bool
path string
cNum = 1 << 3
all bool
path string
cNum = 1 << 3

aFlag = &cli.BoolFlag{
Name: "all",
Aliases: []string{"a"},
Usage: "Download all the diversity of this video.",
Value: all,
aFlag = &cli.BoolFlag{
Name: "all",
Aliases: []string{"a"},
Usage: "Download all the diversity of this video.",
Value: all,
Destination: &all,
}
cFlag = &cli.IntFlag{
Name: "cnum",
Aliases: []string{"c"},
Usage: "The amount of concurrency.",
Value: cNum,
cFlag = &cli.IntFlag{
Name: "cnum",
Aliases: []string{"c"},
Usage: "The amount of concurrency.",
Value: cNum,
Destination: &cNum,
}
pFlag = &cli.StringFlag{
Name: "path",
Aliases: []string{"p"},
Usage: "Storage path.",
Value: path,
pFlag = &cli.StringFlag{
Name: "path",
Aliases: []string{"p"},
Usage: "Storage path.",
Value: path,
Destination: &path,
}
)
Expand All @@ -54,7 +52,7 @@ func tApp() error {
}

func setSettings(app *cli.App) {
app.Flags = []cli.Flag{ aFlag, cFlag, pFlag }
app.Flags = []cli.Flag{aFlag, cFlag, pFlag}
app.Action = func(c *cli.Context) error {
if c.NArg() == 0 {
fmt.Println("Please entry a bv number.")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ggdream/down
module github.com/ggdream/bilibili

go 1.15

Expand Down

0 comments on commit 8c992e7

Please sign in to comment.