doubao_share

package
v0.0.0-...-a58c836 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectoryType      = 1
	FileType           = 2
	LinkType           = 3
	ImageType          = 4
	PagesType          = 5
	VideoType          = 6
	AudioType          = 7
	MeetingMinutesType = 8
)
View Source
const (
	BaseURL       = "https://www.doubao.com"
	FileDataType  = "file"
	ImgDataType   = "image"
	VideoDataType = "video"
	UserAgent     = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
)

Variables

View Source
var FileNodeType = map[int]string{
	1: "directory",
	2: "file",
	3: "link",
	4: "image",
	5: "pages",
	6: "video",
	7: "audio",
	8: "meeting_minutes",
}

Functions

This section is empty.

Types

type Addition

type Addition struct {
	driver.RootPath
	Cookie   string `json:"cookie" type:"text"`
	ShareIds string `json:"share_ids" type:"text" required:"true"`
}

type BaseResp

type BaseResp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

type CommonResp

type CommonResp struct {
	Code    int             `json:"code"`
	Msg     string          `json:"msg,omitempty"`
	Message string          `json:"message,omitempty"` // 错误情况下的消息
	Data    json.RawMessage `json:"data,omitempty"`    // 原始数据,稍后解析
	Error   *struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
		Locale  string `json:"locale"`
	} `json:"error,omitempty"`
}

func (*CommonResp) GetError

func (r *CommonResp) GetError() error

GetError 获取错误信息

func (*CommonResp) IsSuccess

func (r *CommonResp) IsSuccess() bool

IsSuccess 判断响应是否成功

func (*CommonResp) UnmarshalData

func (r *CommonResp) UnmarshalData(v interface{}) error

UnmarshalData 将data字段解析为指定类型

type CreatorInfo

type CreatorInfo struct {
	EntityID string `json:"entity_id"`
	UserName string `json:"user_name"`
	NickName string `json:"nick_name"`
	Avatar   struct {
		OriginURL string `json:"origin_url"`
		TinyURL   string `json:"tiny_url"`
		URI       string `json:"uri"`
	} `json:"avatar"`
}

type DoubaoShare

type DoubaoShare struct {
	model.Storage
	Addition
	RootFiles []RootFileList
}

func (*DoubaoShare) ArchiveDecompress

func (d *DoubaoShare) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, args model.ArchiveDecompressArgs) ([]model.Obj, error)

func (*DoubaoShare) Config

func (d *DoubaoShare) Config() driver.Config

func (*DoubaoShare) Copy

func (d *DoubaoShare) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*DoubaoShare) Drop

func (d *DoubaoShare) Drop(ctx context.Context) error

func (*DoubaoShare) Extract

func (d *DoubaoShare) Extract(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) (*model.Link, error)

func (*DoubaoShare) GetAddition

func (d *DoubaoShare) GetAddition() driver.Additional

func (*DoubaoShare) GetArchiveMeta

func (d *DoubaoShare) GetArchiveMeta(ctx context.Context, obj model.Obj, args model.ArchiveArgs) (model.ArchiveMeta, error)

func (*DoubaoShare) Init

func (d *DoubaoShare) Init(ctx context.Context) error
func (d *DoubaoShare) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*DoubaoShare) List

func (d *DoubaoShare) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*DoubaoShare) ListArchive

func (d *DoubaoShare) ListArchive(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) ([]model.Obj, error)

func (*DoubaoShare) MakeDir

func (d *DoubaoShare) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)

func (*DoubaoShare) Move

func (d *DoubaoShare) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*DoubaoShare) Put

func (*DoubaoShare) Remove

func (d *DoubaoShare) Remove(ctx context.Context, obj model.Obj) error

func (*DoubaoShare) Rename

func (d *DoubaoShare) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)

type File

type File struct {
	ID                  string `json:"id"`
	Name                string `json:"name"`
	Key                 string `json:"key"`
	NodeType            int    `json:"node_type"`
	Size                int64  `json:"size"`
	Source              int    `json:"source"`
	NameReviewStatus    int    `json:"name_review_status"`
	ContentReviewStatus int    `json:"content_review_status"`
	RiskReviewStatus    int    `json:"risk_review_status"`
	ConversationID      string `json:"conversation_id"`
	ParentID            string `json:"parent_id"`
	CreateTime          int64  `json:"create_time"`
	UpdateTime          int64  `json:"update_time"`
}

type FileObject

type FileObject struct {
	model.Object
	ShareID  string
	Key      string
	NodeID   string
	NodeType int
}

type FilePath

type FilePath []struct {
	ID                  string `json:"id"`
	Name                string `json:"name"`
	Key                 string `json:"key"`
	NodeType            int    `json:"node_type"`
	Size                int    `json:"size"`
	Source              int    `json:"source"`
	NameReviewStatus    int    `json:"name_review_status"`
	ContentReviewStatus int    `json:"content_review_status"`
	RiskReviewStatus    int    `json:"risk_review_status"`
	ConversationID      string `json:"conversation_id"`
	ParentID            string `json:"parent_id"`
	CreateTime          int    `json:"create_time"`
	UpdateTime          int    `json:"update_time"`
}

type GetFileUrlResp

type GetFileUrlResp struct {
	BaseResp
	Data struct {
		FileUrls []struct {
			URI     string `json:"uri"`
			MainURL string `json:"main_url"`
			BackURL string `json:"back_url"`
		} `json:"file_urls"`
	} `json:"data"`
}

type GetVideoFileUrlResp

type GetVideoFileUrlResp struct {
	BaseResp
	Data struct {
		MediaType string `json:"media_type"`
		MediaInfo []struct {
			Meta struct {
				Height     string  `json:"height"`
				Width      string  `json:"width"`
				Format     string  `json:"format"`
				Duration   float64 `json:"duration"`
				CodecType  string  `json:"codec_type"`
				Definition string  `json:"definition"`
			} `json:"meta"`
			MainURL   string `json:"main_url"`
			BackupURL string `json:"backup_url"`
		} `json:"media_info"`
		OriginalMediaInfo struct {
			Meta struct {
				Height     string  `json:"height"`
				Width      string  `json:"width"`
				Format     string  `json:"format"`
				Duration   float64 `json:"duration"`
				CodecType  string  `json:"codec_type"`
				Definition string  `json:"definition"`
			} `json:"meta"`
			MainURL   string `json:"main_url"`
			BackupURL string `json:"backup_url"`
		} `json:"original_media_info"`
		PosterURL      string `json:"poster_url"`
		PlayableStatus int    `json:"playable_status"`
	} `json:"data"`
}

type NodeInfoData

type NodeInfoData struct {
	Share      ShareInfo   `json:"share,omitempty"`
	Creator    CreatorInfo `json:"creator,omitempty"`
	NodeList   []File      `json:"node_list,omitempty"`
	NodeInfo   File        `json:"node_info,omitempty"`
	Children   []File      `json:"children,omitempty"`
	Path       FilePath    `json:"path,omitempty"`
	NextCursor string      `json:"next_cursor,omitempty"`
	HasMore    bool        `json:"has_more,omitempty"`
}

type NodeInfoResp

type NodeInfoResp struct {
	BaseResp
	NodeInfoData `json:"data"`
}

type RootFileList

type RootFileList struct {
	ShareID     string
	VirtualPath string
	NodeInfo    NodeInfoData
	Child       *[]RootFileList
}

type ShareInfo

type ShareInfo struct {
	ShareID   string `json:"share_id"`
	FirstNode struct {
		ID       string `json:"id"`
		Name     string `json:"name"`
		Key      string `json:"key"`
		NodeType int    `json:"node_type"`
		Size     int    `json:"size"`
		Source   int    `json:"source"`
		Content  struct {
			LinkFileType  string `json:"link_file_type"`
			ImageWidth    int    `json:"image_width"`
			ImageHeight   int    `json:"image_height"`
			AiSkillStatus int    `json:"ai_skill_status"`
		} `json:"content"`
		NameReviewStatus    int    `json:"name_review_status"`
		ContentReviewStatus int    `json:"content_review_status"`
		RiskReviewStatus    int    `json:"risk_review_status"`
		ConversationID      string `json:"conversation_id"`
		ParentID            string `json:"parent_id"`
		CreateTime          int    `json:"create_time"`
		UpdateTime          int    `json:"update_time"`
	} `json:"first_node"`
	NodeCount      int    `json:"node_count"`
	CreateTime     int    `json:"create_time"`
	Channel        string `json:"channel"`
	InfluencerType int    `json:"influencer_type"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL