lanzou

package
v3.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: AGPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const DAY time.Duration = 84600000000000

Variables

This section is empty.

Functions

func CalcAcwScV2

func CalcAcwScV2(html string) (string, error)

在页面被过多访问或其他情况下,有时候会先返回一个加密的页面,其执行计算出一个acw_sc__v2后放入页面后再重新访问页面才能获得正常页面 若该页面进行了js加密,则进行解密,计算acw_sc__v2,并加入cookie

func HexXor

func HexXor(hex1, hex2 string) string

func IsNumber

func IsNumber(str string) bool

func MustParseTime

func MustParseTime(str string) time.Time

func RemoveNotes

func RemoveNotes(html []byte) []byte

移除注释

func SizeStrToInt64

func SizeStrToInt64(size string) int64

func Unbox

func Unbox(hex string) string

Types

type Addition

type Addition struct {
	Type   string `json:"type" type:"select" options:"cookie,url" default:"cookie"`
	Cookie string `json:"cookie" required:"true" help:"about 15 days valid"`
	driver.RootID
	SharePassword string `json:"share_password"`
	BaseUrl       string `json:"baseUrl" required:"true" default:"https://pc.woozooo.com"`
	ShareUrl      string `json:"shareUrl" required:"true" default:"https://pan.lanzouo.com"`
}

func (*Addition) IsCookie

func (a *Addition) IsCookie() bool

type FileInfoAndUrlByShareUrl

type FileInfoAndUrlByShareUrl struct {
	ID   string
	Name string
	Size string
	Time string
	Url  string
}

通过分享链接获取文件信息和下载链接

func (*FileInfoAndUrlByShareUrl) ToObj

func (f *FileInfoAndUrlByShareUrl) ToObj() model.Obj

type FileOrFolder

type FileOrFolder struct {
	Name string `json:"name"`

	// 文件通用
	ID      string `json:"id"`
	NameAll string `json:"name_all"`
	Size    string `json:"size"`
	Time    string `json:"time"`

	// 文件夹
	FolID string `json:"fol_id"`
}

func (*FileOrFolder) ToObj

func (f *FileOrFolder) ToObj() model.Obj

type FileOrFolderByShareUrl

type FileOrFolderByShareUrl struct {
	ID      string `json:"id"`
	NameAll string `json:"name_all"`
	Size    string `json:"size"`
	Time    string `json:"time"`
	Duan    string `json:"duan"`
	//Icon          string `json:"icon"`
	//PIco int `json:"p_ico"`
	//T int `json:"t"`
	IsFloder bool
}

func (*FileOrFolderByShareUrl) ToObj

func (f *FileOrFolderByShareUrl) ToObj() model.Obj

type FileOrFolderByShareUrlResp

type FileOrFolderByShareUrlResp struct {
	Text []FileOrFolderByShareUrl `json:"text"`
}

type FileShare

type FileShare struct {
	Pwd    string `json:"pwd"`
	Onof   string `json:"onof"`
	Taoc   string `json:"taoc"`
	IsNewd string `json:"is_newd"`

	// 文件
	FID string `json:"f_id"`

	// 文件夹
	NewUrl string `json:"new_url"`
	Name   string `json:"name"`
	Des    string `json:"des"`
}

type FileShareInfoAndUrlResp

type FileShareInfoAndUrlResp[T string | int] struct {
	Dom string `json:"dom"`
	URL string `json:"url"`
	Inf T      `json:"inf"`
}

func (*FileShareInfoAndUrlResp[T]) GetBaseUrl

func (u *FileShareInfoAndUrlResp[T]) GetBaseUrl() string

func (*FileShareInfoAndUrlResp[T]) GetDownloadUrl

func (u *FileShareInfoAndUrlResp[T]) GetDownloadUrl() string

type FileShareResp

type FileShareResp struct {
	Info FileShare `json:"info"`
}

type FilesOrFoldersResp

type FilesOrFoldersResp struct {
	Text []FileOrFolder `json:"text"`
}

type LanZou

type LanZou struct {
	Addition
	model.Storage
}

func (*LanZou) Config

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

func (*LanZou) Copy

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

func (*LanZou) Drop

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

func (*LanZou) GetAddition

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

func (*LanZou) GetFileOrFolderByShareUrl

func (d *LanZou) GetFileOrFolderByShareUrl(ctx context.Context, downID, pwd string) ([]model.Obj, error)

通过分享链接获取文件或文件夹,如果是文件则会返回下载链接

func (*LanZou) GetFiles

func (d *LanZou) GetFiles(ctx context.Context, folderID string) ([]model.Obj, error)

获取文件和文件夹,获取到的文件大小、更改时间不可信

func (*LanZou) Init

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

func (*LanZou) List

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

获取的大小和时间不准确

func (*LanZou) MakeDir

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

func (*LanZou) Move

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

func (*LanZou) Put

func (d *LanZou) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error

func (*LanZou) Remove

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

func (*LanZou) Rename

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

Jump to

Keyboard shortcuts

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