actress

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package actress Emby 媒体库演员头像管理包。

通过本包,可下载 javbus 及 javdb 网站中女优头像到本地, 也可将本地保存的女优头像导入 Emby 媒体库中。

atress 包目前仅支持 Emby 媒体库,且仅支持 javbus 及 javdb两个网站, 两个网站皆分为有码女优及无码女优两种女优头像,通过传入不同参数进行区分。

包自动判断是否拥有下一页,若存在下一页则自动获取下一页数据,没有获取到 则停止下载。

头像入库通过 Emby 媒体库提供的 api,将本地女优头像转换为 Base64 编码, 并模拟上传到 Emby 媒体库中。

头像入库时,会首先在 Emby 中查询是否存在此女优信息,若存在则判断是否已有 头像信息,没有头像才会进行上传入库。

Index

Constants

View Source
const (
	// JAVBUS 是 javbus 网站名称常量
	JAVBUS = "JAVBUS"
	// JAVDB 是 javdb 网站名称常量
	JAVDB = "JAVDB"
)

Variables

This section is empty.

Functions

func JavBUS

func JavBUS(site, proxy string, page int, censored bool) (actress map[string]string, nextPage bool, err error)

JavBUS 采集

func JavDB

func JavDB(site, proxy string, page int, censored bool) (actress map[string]string, nextPage bool, err error)

JavDB 采集

Types

type Actress

type Actress struct {
	// contains filtered or unexported fields
}

Actress 头像管理结构体

func NewActress

func NewActress() *Actress

NewActress 返回一个Actress对象。 引用util.GetConfig方法读取配置文件, 配置文件读取失败则返回空对象。

func (*Actress) Fetch

func (a *Actress) Fetch(site string, page int, censored bool) error

Fetch 远程女优头像下载。 通过传入参数获取远程网站女优头像图片并下载到本地。 所有图片均下载到程序执行目录下的 actress 文件夹中。

site 字符串参数,指定要下载的网站名称,参见常量定义, page 整数参数,指定要下载的开始页面, censored 逻辑参数,指定下载的是有码女优还是无码女优。

func (*Actress) Put

func (a *Actress) Put() error

Put 本地图片入库 扫描程序执行目录下的 actress 文件夹, 将其中的所有女优头像依次入库到 Emby 中。

type Emby

type Emby struct {
	// contains filtered or unexported fields
}

Emby Emby媒体库结构体

func NewEmby

func NewEmby(hostURL, apiKey string) *Emby

NewEmby 返回一个被初始化的 Emby 对象

hostURL 字符串参数,传入 Emby 媒体库访问地址, apiKey 字符串参数,传入 Emby 的 API Key。

func (*Emby) Actor

func (emby *Emby) Actor(name, face string) error

Actor 单个女优头像入库

name 字符串参数,传入女优姓名,必须与 Emby 中一致才会入库, face 字符串参数,传入女优头像图片本地路径。

Jump to

Keyboard shortcuts

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