feat(dl): chat mode. WIP

This commit is contained in:
iyear 2022-09-13 09:35:09 +08:00
parent 0496e3177a
commit 22d1816d90
2 changed files with 42 additions and 0 deletions

7
app/dl/dlchat/chat.go Normal file
View file

@ -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 {
}

35
cmd/dl/chat.go Normal file
View file

@ -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)
}