✨ Support list playlist image

This commit is contained in:
openwaygate authored and OpenWaygate committed 2025-05-31 22:57:38 +08:00
1 parent 46f2fb1f89
commit a729d0519c
2 files changed
+69

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
package playlistImage
import (
"github.com/eat-pray-ai/yutu/pkg/playlistImage"
"github.com/spf13/cobra"
)
var listCmd = &cobra.Command{
Use: "list",
Short: "List YouTube playlist images",
Long: "List YouTube playlist images' info",
Run: func(cmd *cobra.Command, args []string) {
pi := playlistImage.NewPlaylistImage(
playlistImage.WithParent(parent),
playlistImage.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
playlistImage.WithOnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel),
playlistImage.WithMaxResults(maxResults),
playlistImage.WithService(nil),
)
pi.List(parts, output)
},
}
func init() {
playlistImageCmd.AddCommand(listCmd)
listCmd.Flags().StringVarP(&parent, "parent", "p", "", "Return PlaylistImages for this playlist id")
listCmd.Flags().StringVarP(&onBehalfOfContentOwner, "onBehalfOfContentOwner", "b", "", "")
listCmd.Flags().StringVarP(&onBehalfOfContentOwnerChannel, "onBehalfOfContentOwnerChannel", "B", "", "")
listCmd.Flags().Int64VarP(&maxResults, "maxResults", "n", 5, "The maximum number of items that should be returned")
listCmd.Flags().StringSliceVarP(&parts, "parts", "p", []string{"id", "kind", "snippet"}, "Comma separated parts")
listCmd.Flags().StringVarP(&output, "output", "o", "", "json or yaml")
}
+36
View File
@@ -0,0 +1,36 @@
package playlistImage
import (
"github.com/eat-pray-ai/yutu/cmd"
"github.com/spf13/cobra"
)
var (
id string
kind string
height int64
playlistId string
type_ string
width int64
file string
parent string
maxResults int64
parts []string
output string
onBehalfOfContentOwner string
onBehalfOfContentOwnerChannel string
)
var playlistImageCmd = &cobra.Command{
Use: "playlistImage",
Short: "Manipulate YouTube playlist images",
Long: "List, insert, update, or delete YouTube playlist images.",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
}
func init() {
cmd.RootCmd.AddCommand(playlistImageCmd)
}