Files
SaveAny-Bot/pkg/tcbdata/data.go
Krau 302db2fe75 feat: parse url with js plugins support (#96)
* feat: WIP. add parser functionality and text message handling

* fix: use json to marshal js result

* feat: add metadata handling and version validation for jsParser

* refactor: rename parser package to parsers and restructure parser handling

* refactor: core code struct and impl parse task handle

* feat: impl parsed download

* fix: seek cache file when processing tph picture

* feat: implement parsed task handling and progress tracking

* feat: enhance task processing with concurrency control and progress tracking

* feat: add resource ID generation and improve resource processing handling

* feat: improve message formatting in parsed text and progress completion

* feat: add example js plugin

* feat: implement Twitter parser

* fix: twitter parse video json decode error

* feat: impl stream mode for parse task
2025-08-21 23:48:17 +08:00

49 lines
994 B
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"
)
// 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
}
type SetDefaultStorage struct {
StorageName string
}