config

package
v0.0.0-...-3ead46a Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Apps = AppConfig{}
View Source
var Current = &BookInfo{}
View Source
var FileLock = &sync.Mutex{}
View Source
var HelpMessage = []string{"input help to see the command list:",
	"input quit to quit",
	"input download <bookid/url> to download book",
	"input search <keyword> to search book",
	"input show to show config",
	"input update config to update config by config.json",
	"input login <account> <password> to login account",
	"input app <app app keyword> to change app type",
	"input max <thread> to change max thread number",
	"you can input command like this: download <bookid/url>\n\n",
}
View Source
var Vars = &Apps.Config

Functions

func Error

func Error(Message string, err error, Line int) error

func Exist

func Exist(fileName any) bool

func FindID

func FindID(url string) string

func LoadJson

func LoadJson()

func ReadConfig

func ReadConfig(fileName string) []byte

func SaveJson

func SaveJson()

func UpdateConfig

func UpdateConfig()

Types

type AppConfig

type AppConfig struct {
	Hbooker HbookerCommonParams `json:"common_params"`
	Sfacg   BoluobaoConfig      `json:"sfacg_config"`
	Config  ScriptConfig        `json:"script_config"`
}

type BoluobaoConfig

type BoluobaoConfig struct {
	UserName     string `json:"account"`
	Password     string `json:"password"`
	Cookie       string `json:"cookie"`
	WeChatCookie string `json:"we_chat_cookie"`
}

type BookInfo

type BookInfo struct {
	Book       Books
	NewBooks   map[string]string
	OutputPath string
	ConfigPath string
	CoverPath  string
	//BackupsPath  string
	BookInfoList []Books
	DownloadList []string
}

type Books

type Books struct {
	NovelName  string
	NovelID    string
	IsFinish   bool
	MarkCount  string
	NovelCover string
	AuthorName string
	CharCount  string
	SignStatus string
}

type HbookerCommonParams

type HbookerCommonParams struct {
	LoginToken  string `json:"login_token"`
	Account     string `json:"account"`
	AppVersion  string `json:"app_version"`
	DeviceToken string `json:"device_token"`
}

type ScriptConfig

type ScriptConfig struct {
	ConfigName string `json:"config_name"`
	OutputName string `json:"output_name"`
	CoverFile  string `json:"cover_file"`
	DeviceId   string `json:"device_id"`
	ThreadNum  int    `json:"thread_num"`
	MaxRetry   int    `json:"max_retry"`
	Epub       bool   `json:"epub"`
}

Jump to

Keyboard shortcuts

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