alist

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(uri, method string, header http.Header, body map[string]interface{}) model.HttpRes[*jsons.Item]

Fetch 请求 alist api

func FetchFsGet

func FetchFsGet(path string, header http.Header) model.HttpRes[*jsons.Item]

FetchFsGet 请求 alist "/api/fs/get" 接口

传入 path 与接口的 path 作用一致

func FetchFsList

func FetchFsList(path string, header http.Header) model.HttpRes[*jsons.Item]

FetchFsList 请求 alist "/api/fs/list" 接口

传入 path 与接口的 path 作用一致

func FetchFsOther

func FetchFsOther(path string, header http.Header) model.HttpRes[*jsons.Item]

FetchFsOther 请求 alist "/api/fs/other" 接口

传入 path 与接口的 path 作用一致

func FetchResource

func FetchResource(fi FetchInfo) model.HttpRes[Resource]

FetchResource 请求 alist 资源 url 直链

Types

type FetchInfo

type FetchInfo struct {
	Path                  string      // alist 资源绝对路径
	UseTranscode          bool        // 是否请求转码资源 (只支持视频资源)
	Format                string      // 要请求的转码资源格式, 如: FHD
	TryRawIfTranscodeFail bool        // 如果请求转码资源失败, 是否尝试请求原画资源
	Header                http.Header // 自定义的请求头
}

FetchInfo 请求 alist 资源需要的参数信息

type Resource

type Resource struct {
	Url       string         // 资源远程路径
	Subtitles []SubtitleInfo // 字幕信息
}

Resource alist 资源信息封装

type SubtitleInfo

type SubtitleInfo struct {
	Lang string // 字幕语言
	Url  string // 字幕远程路径
}

SubtitleInfo 资源内嵌的字幕信息

Jump to

Keyboard shortcuts

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