alist

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanHeader added in v1.7.5

func CleanHeader(header http.Header) http.Header

CleanHeader 清理请求头

func Fetch

func Fetch(uri, method string, header http.Header, body map[string]any) 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 直链

func PathDecode added in v1.7.3

func PathDecode(encPath string) string

PathDecode 对 alist 的编码路径进行解码, 返回原始路径

如果解码失败, 则返回原路径

func PathEncode added in v1.7.3

func PathEncode(rawPath string) string

PathEncode 将 alist 的资源原始路径进行编码, 防止路径在传输过程中出现错误

func SubLangDisplayName added in v1.7.0

func SubLangDisplayName(lang string) string

SubLangDisplayName 将 lang 转换成对应名称

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