From 22d1816d905054b0a44dc5b518866db0f59b7f60 Mon Sep 17 00:00:00 2001 From: iyear Date: Tue, 13 Sep 2022 09:35:09 +0800 Subject: [PATCH] feat(dl): chat mode. WIP --- app/dl/dlchat/chat.go | 7 +++++++ cmd/dl/chat.go | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 app/dl/dlchat/chat.go create mode 100644 cmd/dl/chat.go diff --git a/app/dl/dlchat/chat.go b/app/dl/dlchat/chat.go new file mode 100644 index 0000000..09a32c8 --- /dev/null +++ b/app/dl/dlchat/chat.go @@ -0,0 +1,7 @@ +package dlchat + +import "context" + +func Run(ctx context.Context, ns, proxy string, partSize, threads, limit int, chat string, from, to int) error { + +} diff --git a/cmd/dl/chat.go b/cmd/dl/chat.go new file mode 100644 index 0000000..e97da34 --- /dev/null +++ b/cmd/dl/chat.go @@ -0,0 +1,35 @@ +package dl + +import ( + "github.com/iyear/tdl/app/dl/dlchat" + "github.com/spf13/cobra" +) + +var ( + chat string + from, to int +) + +var cmdChat = &cobra.Command{ + Use: "chat", + Short: "Download in chat mode", + Example: "tdl dl chat ", + RunE: func(cmd *cobra.Command, args []string) error { + proxy, err := cmd.Flags().GetString("proxy") + if err != nil { + return err + } + + ns, err := cmd.Flags().GetString("ns") + if err != nil { + return err + } + + return dlchat.Run(cmd.Context(), ns, proxy, partSize, threads, limit) + }, +} + +func init() { + cmdChat.Flags().StringVarP(&chat, "chat", "c", "", "accp") + cmdChat.Flags().IntVar(&from, "from", 0) +}