utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCookieRefreshTokenInput = errors.New("cookie input is not supported; provide a Pixiv App API refresh token")

ErrCookieRefreshTokenInput 表示调用方误把网页 Cookie 当成 App API refresh token。 此错误不包含输入内容,避免凭据进入 CLI、MCP 或日志输出。

Functions

func Deduplicate

func Deduplicate(ids []int64) []int64

func GenerateFilename

func GenerateFilename(data FilenameData, page int, template string) string

func SanitizeFilename

func SanitizeFilename(name string) string

func ValidateRefreshTokenInput added in v0.3.0

func ValidateRefreshTokenInput(input string) (string, error)

ValidateRefreshTokenInput 只接受 Pixiv App API 的不透明 refresh token。单个 "x=y" 仍可能是合法 token;但 Cookie 的明确名称或多 cookie pair 一律拒绝,绝不 从中提取或转换 refresh_token。

Types

type FilenameData

type FilenameData struct {
	ID        int64
	Author    string
	Title     string
	PageCount int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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