go-youtubekids-client/examples/browse/main.go

30 lines
617 B
Go
Raw Normal View History

package main
import (
"context"
"encoding/json"
youtubekids "githouse.ru/feelter-ugc/go-youtubekids-client"
"log"
)
func main() {
client, err := youtubekids.NewClient(youtubekids.DefaultServerURL)
if err != nil {
panic(err)
}
response, err := client.Browse(context.TODO(), (&youtubekids.BrowseRequestPayload{
BrowseId: youtubekids.BrowseIdForKidsHome,
Context: youtubekids.RequestContext{
Client: youtubekids.RequestClient{},
},
}).SetDefaults())
if err != nil {
panic(err)
}
data, err := json.MarshalIndent(response, "", " ")
if err != nil {
panic(err)
}
log.Println(string(data))
}