* Initial plan * Implement parameter support for /ytdlp command Co-authored-by: krau <71133316+krau@users.noreply.github.com> * Add comprehensive tests for ytdlp parameter parsing Co-authored-by: krau <71133316+krau@users.noreply.github.com> * Improve flag parsing logic and clarify argument order Co-authored-by: krau <71133316+krau@users.noreply.github.com> * Preserve critical defaults and improve comments Co-authored-by: krau <71133316+krau@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: krau <71133316+krau@users.noreply.github.com>
59 lines
1.2 KiB
Go
59 lines
1.2 KiB
Go
package tcbdata
|
|
|
|
import (
|
|
"github.com/krau/SaveAny-Bot/pkg/enums/tasktype"
|
|
"github.com/krau/SaveAny-Bot/pkg/parser"
|
|
"github.com/krau/SaveAny-Bot/pkg/telegraph"
|
|
"github.com/krau/SaveAny-Bot/pkg/tfile"
|
|
)
|
|
|
|
const (
|
|
TypeAdd = "add"
|
|
TypeSetDefault = "setdefault"
|
|
TypeConfig = "config"
|
|
TypeCancel = "cancel"
|
|
)
|
|
|
|
// type TaskDataTGFiles struct {
|
|
// Files []tfile.TGFileMessage
|
|
// AsBatch bool
|
|
// }
|
|
|
|
// type TaskDataTelegraph struct {
|
|
// Pics []string
|
|
// PageNode *telegraph.Page
|
|
// }
|
|
|
|
// type TaskDataType interface {
|
|
// TaskDataTGFiles | TaskDataTelegraph
|
|
// }
|
|
|
|
type Add struct {
|
|
// [TODO] maybe we should to spilit this into different types...
|
|
TaskType tasktype.TaskType
|
|
SelectedStorName string
|
|
DirID uint
|
|
SettedDir bool
|
|
// tfiles
|
|
Files []tfile.TGFileMessage
|
|
AsBatch bool
|
|
// tphpics
|
|
TphPageNode *telegraph.Page
|
|
TphPics []string
|
|
TphDirPath string // unescaped telegraph.Page.Path
|
|
// parseditem
|
|
ParsedItem *parser.Item
|
|
// directlinks
|
|
DirectLinks []string
|
|
// aria2
|
|
Aria2URIs []string
|
|
// ytdlp
|
|
YtdlpURLs []string
|
|
YtdlpFlags []string
|
|
}
|
|
|
|
type SetDefaultStorage struct {
|
|
StorageName string
|
|
DirID uint
|
|
}
|