feat: add yt-dlp support for downloading video/audio and enhance related commands
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package tasktype
|
||||
|
||||
//go:generate go-enum --values --names --flag --nocase
|
||||
// ENUM(tgfiles,tphpics,parseditem,directlinks,aria2)
|
||||
// ENUM(tgfiles,tphpics,parseditem,directlinks,aria2,ytdlp)
|
||||
type TaskType string
|
||||
|
||||
@@ -22,6 +22,8 @@ const (
|
||||
TaskTypeDirectlinks TaskType = "directlinks"
|
||||
// TaskTypeAria2 is a TaskType of type aria2.
|
||||
TaskTypeAria2 TaskType = "aria2"
|
||||
// TaskTypeYtdlp is a TaskType of type ytdlp.
|
||||
TaskTypeYtdlp TaskType = "ytdlp"
|
||||
)
|
||||
|
||||
var ErrInvalidTaskType = fmt.Errorf("not a valid TaskType, try [%s]", strings.Join(_TaskTypeNames, ", "))
|
||||
@@ -32,6 +34,7 @@ var _TaskTypeNames = []string{
|
||||
string(TaskTypeParseditem),
|
||||
string(TaskTypeDirectlinks),
|
||||
string(TaskTypeAria2),
|
||||
string(TaskTypeYtdlp),
|
||||
}
|
||||
|
||||
// TaskTypeNames returns a list of possible string values of TaskType.
|
||||
@@ -49,6 +52,7 @@ func TaskTypeValues() []TaskType {
|
||||
TaskTypeParseditem,
|
||||
TaskTypeDirectlinks,
|
||||
TaskTypeAria2,
|
||||
TaskTypeYtdlp,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +74,7 @@ var _TaskTypeValue = map[string]TaskType{
|
||||
"parseditem": TaskTypeParseditem,
|
||||
"directlinks": TaskTypeDirectlinks,
|
||||
"aria2": TaskTypeAria2,
|
||||
"ytdlp": TaskTypeYtdlp,
|
||||
}
|
||||
|
||||
// ParseTaskType attempts to convert a string to a TaskType.
|
||||
|
||||
@@ -47,6 +47,8 @@ type Add struct {
|
||||
DirectLinks []string
|
||||
// aria2
|
||||
Aria2URIs []string
|
||||
// ytdlp
|
||||
YtdlpURLs []string
|
||||
}
|
||||
|
||||
type SetDefaultStorage struct {
|
||||
|
||||
Reference in New Issue
Block a user