Make response type an/single/playlist

Make it possible to assert what response to get
This commit is contained in:
Mattias Wadman
2019-11-01 00:01:13 +01:00
parent 941a4092e2
commit 5b6ef4f1f2
3 changed files with 54 additions and 21 deletions

View File

@ -12,12 +12,14 @@ import (
)
var dumpFlag = flag.Bool("J", false, "Dump JSON")
var typeFlag = flag.String("t", "any", "Type")
func main() {
log.SetFlags(0)
flag.Parse()
result, err := goutubedl.New(context.Background(), flag.Arg(0), goutubedl.Options{})
optType, _ := goutubedl.TypeFromString[*typeFlag]
result, err := goutubedl.New(context.Background(), flag.Arg(0), goutubedl.Options{Type: optType})
if err != nil {
log.Fatal(err)
}