javkit

package
v0.0.0-...-11bd1ee Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

这是对 python 版本 javkit 的 golang 化

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandCompleter

func CommandCompleter(d prompt.Document) []prompt.Suggest

func CreateNewFolder

func CreateNewFolder(path string, info JavInfo, config IniConfig) string

CreateNewFolder 对每个 Jav 创建单独的文件夹

func CreateNfo

func CreateNfo(path string, javInfo JavInfo, config IniConfig)

CreateNfo 创建相应影片的 nfo 信息

func CreateSymlink(path, newFolderPath string, info JavInfo)

func DownloadPicAsync

func DownloadPicAsync(errorTimes int, picUrl string, config *IniConfig, pPicData *[]byte, pDownloadErr *error, done func())

func Exists

func Exists(path string) bool

Exists 判断路径是否存在

func GetConfig

func GetConfig(configType string, path string) (interface{}, error)

GetConfig 根据配置后缀名使用不同工具加载并统一, **目前不可用**

func GetVideoTitle

func GetVideoTitle(name string) (string, error)

GetVideoTitle 正则匹配找出番号

func MakePoster

func MakePoster(fanartPath string) error

MakePoster 用来生成 poster,并且完成封面的重命名

func MoveFile

func MoveFile(sourcePath, destPath string) error

func PathCompleter

func PathCompleter(d prompt.Document) []prompt.Suggest

func PrintWithTime

func PrintWithTime(message ...string)

func RenameAndMoveVideo

func RenameAndMoveVideo(videoPath string, info JavInfo, config IniConfig, path string) (string, error)

RenameAndMoveVideo 重命名并移动影片到新的文件夹

func SavePic

func SavePic(picPath string, picData []byte) error

SavePic 下载封面

Types

type IniConfig

type IniConfig struct {
	IfNfo                 string
	IfExnfo               string
	IfReview              string
	CustomTitle           string
	CustomSubtitle        string
	IfMP4                 string
	RenameMP4             string
	IfFolder              string
	RenameFolder          string
	IfClassify            string
	IgnoreParentErr       string
	ClassifyRoot          string
	ClassifyBasis         string
	CreateSymboliclink    string
	SymboliclinkDirectory string
	IfJpg                 string
	CustomFanart          string
	CustomPoster          string
	IfSculpture           string
	IfProxy               string
	Proxy                 string
	IfPlot                string
	IfTran                string
	TransId               string
	TransSk               string
	SimpTrad              string
	LibraryUrl            string
	BusUrl                string
	SurenPref             string
	FileType              string
	TitleLen              int
	Script                string
	Interpreter           string
}

IniConfig 用于对相关的 ini 配置文件反序列化

func GetIniConfig

func GetIniConfig(configType string, path string) (IniConfig, error)

GetIniConfig 获取 ini 配置并根据类型转换为不同的 config

type JavFile

type JavFile struct {
	Path     string // 视频文件名称
	License  string // 车牌-番号
	Episodes int    // 集数

}

JavFile 每部 jav 的结构体

func GetJavFromFolder

func GetJavFromFolder(path string, config IniConfig) []JavFile

GetJavFromFolder 从给定目录中查找影片,创建 Jav 对象

type JavInfo

type JavInfo struct {
	License       string
	LicensePrefix string
	Title         string
	FullTitle     string
	Director      string
	Release       JavReleaseDate
	Studio        string
	Score         string
	FirstActress  string
	AllActress    []string
	Length        int
	ChineseSub    bool
	VideoName     string
	CoverUrl      string
	Review        string // 精彩评论
	Introduction  string // 作品介绍
	Genres        []string
}

func CreateDefaultJavInfo

func CreateDefaultJavInfo() JavInfo

CreateDefaultJavInfo 创建带默认值的 javInfo

func GetJavInfo

func GetJavInfo(url string, config IniConfig) (JavInfo, error)

GetJavInfo 获取影片信息

type JavReleaseDate

type JavReleaseDate struct {
	Year     string
	Month    string
	Day      string
	FullDate string
}

type MovieInfo

type MovieInfo struct {
	XMLName      xml.Name `xml:"movie"`
	Text         string   `xml:",chardata"`
	Plot         string   `xml:"plot"`
	Outline      string   `xml:"outline"`
	Customrating string   `xml:"customrating"`
	Lockdata     string   `xml:"lockdata"`
	Dateadded    string   `xml:"dateadded"`
	Title        string   `xml:"title"`
	Director     string   `xml:"director"`
	Rating       string   `xml:"rating"`
	Year         string   `xml:"year"`
	Mpaa         string   `xml:"mpaa"`
	Imdbid       string   `xml:"imdbid"`
	Countrycode  string   `xml:"countrycode"`
	Premiered    string   `xml:"premiered"`
	Releasedate  string   `xml:"releasedate"`
	Criticrating string   `xml:"criticrating"`
	Runtime      string   `xml:"runtime"`
	Country      string   `xml:"country"`
	GenreList    []string `xml:"genre"`
	Studio       string   `xml:"studio"`
	TagList      []string `xml:"tag"`
	Art          struct {
		Text   string   `xml:",chardata"`
		Poster string   `xml:"poster"`
		Fanart []string `xml:"fanart"`
	} `xml:"art"`
	Isuserfavorite string `xml:"isuserfavorite"`
	Playcount      string `xml:"playcount"`
	Watched        string `xml:"watched"`
	Resume         struct {
		Text     string `xml:",chardata"`
		Position string `xml:"position"`
		Total    string `xml:"total"`
	} `xml:"resume"`
	ActorList []actor  `xml:"actor"`
	ID        string   `xml:"id"`
	Fileinfo  fileInfo `xml:"fileinfo"`
	Release   string   `xml:"release"`
	Num       string   `xml:"num"`
}

type TomlConfig

type TomlConfig struct {
	ColletNfo struct {
		SkipFolderWithNfo bool   `toml:"skipFolderWithNfo"`
		CollectNfo        bool   `toml:"collectNfo"`
		CollectReview     bool   `toml:"collectReview"`
		TitleStyle        string `toml:"titleStyle"`
		ChineseSubStyle   string `toml:"chineseSubStyle"`
	} `toml:"colletNfo"`
	MoveVideo struct {
		RenameVideo   bool   `toml:"renameVideo"`
		RenamePattern string `toml:"renamePattern"`
	} `toml:"moveVideo"`
	ModifyFolder struct {
		Mkdir         bool   `toml:"mkdir"`
		FolderPattern string `toml:"folderPattern"`
	} `toml:"modifyFolder"`
	Archive struct {
		Archive              bool   `toml:"archive"`
		IgnoreUpperPathError bool   `toml:"ignoreUpperPathError"`
		RootPath             string `toml:"rootPath"`
		Symlink              bool   `toml:"symlink"`
		ArchivePattern       string `toml:"archivePattern"`
		SymlinkPath          string `toml:"symlinkPath"`
	} `toml:"archive"`
	Introduction struct {
		CollectIntroduction bool `toml:"collectIntroduction"`
	} `toml:"introduction"`
	Cover struct {
		DownloadCover bool   `toml:"downloadCover"`
		FanartPattern string `toml:"fanartPattern"`
		PosterPattern string `toml:"posterPattern"`
	} `toml:"cover"`
	Proxy struct {
		UseProxy bool   `toml:"useProxy"`
		ProxyURL string `toml:"proxyUrl"`
	} `toml:"proxy"`
	Other struct {
		SimpleTradition   string `toml:"simpleTradition"`
		Javlibrary        string `toml:"javlibrary"`
		Javbus            string `toml:"javbus"`
		Suren             string `toml:"suren"`
		RenameTitleLength int    `toml:"renameTitleLength"`
		PythonScript      string `toml:"pythonScript"`
	} `toml:"other"`
}

TomlConfig 用于对相关的 toml 配置文件反序列化

Jump to

Keyboard shortcuts

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