kemono

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFavourites

func GetFavourites(dlOptions *KemonoDlOptions) ([]*httpfuncs.ToDownload, []*httpfuncs.ToDownload, []error)

func GetMultipleCreators

func GetMultipleCreators(creators []*KemonoCreatorToDl, dlOptions *KemonoDlOptions) (urlsToDownload []*httpfuncs.ToDownload, gdriveLinks []*httpfuncs.ToDownload, errSlice []error)

func GetMultiplePosts

func GetMultiplePosts(posts []*KemonoPostToDl, dlOptions *KemonoDlOptions) (urlsToDownload []*httpfuncs.ToDownload, gdriveLinks []*httpfuncs.ToDownload, errSlice []error)

Types

type KemonoCreatorToDl

type KemonoCreatorToDl struct {
	Service   string
	CreatorId string
	PageNum   string
}

func ProcessCreatorUrls

func ProcessCreatorUrls(creatorUrls []string, pageNums []string) []*KemonoCreatorToDl

type KemonoDl

type KemonoDl struct {
	CreatorUrls     []string
	CreatorPageNums []string
	CreatorsToDl    []*KemonoCreatorToDl

	PostUrls  []string
	PostsToDl []*KemonoPostToDl

	DlFav bool
}

func (*KemonoDl) RemoveDuplicates

func (k *KemonoDl) RemoveDuplicates()

RemoveDuplicates removes duplicate creators and posts from the slice

func (*KemonoDl) ValidateArgs

func (k *KemonoDl) ValidateArgs() error

type KemonoDlOptions

type KemonoDlOptions struct {
	DlAttachments       bool
	DlGdrive            bool
	UseCacheDb          bool
	BaseDownloadDirPath string

	Configs *configs.Config

	// GdriveClient is the Google Drive client to be
	// used in the download process for Pixiv Fanbox posts
	GdriveClient *gdrive.GDrive

	SessionCookieId string
	SessionCookies  []*http.Cookie

	Notifier notify.Notifier

	// Progress indicators
	MainProgBar          progress.ProgressBar
	DownloadProgressBars *[]*progress.DownloadProgressBar
	// contains filtered or unexported fields
}

KemonoDlOptions is the struct that contains the arguments for Kemono download options.

func (*KemonoDlOptions) CancelCtx added in v1.1.0

func (k *KemonoDlOptions) CancelCtx()

CancelCtx releases the resources used and cancels the context of the KemonoDlOptions struct.

func (*KemonoDlOptions) CtxIsActive added in v1.1.0

func (k *KemonoDlOptions) CtxIsActive() bool

func (*KemonoDlOptions) GetContext

func (k *KemonoDlOptions) GetContext() context.Context

func (*KemonoDlOptions) SetContext

func (k *KemonoDlOptions) SetContext(ctx context.Context)

func (*KemonoDlOptions) ValidateArgs

func (k *KemonoDlOptions) ValidateArgs(userAgent string) error

ValidateArgs validates the session cookie ID of the Kemono account to download from. It also validates the Google Drive client if the user wants to download to Google Drive.

Should be called after initialising the struct.

type KemonoFavCreatorJson

type KemonoFavCreatorJson []struct {
	FavedSeq int    `json:"faved_seq"`
	Id       string `json:"id"`
	Indexed  string `json:"indexed"`
	Name     string `json:"name"`
	Service  string `json:"service"`
	Updated  string `json:"updated"`
}

type KemonoJson

type KemonoJson []*MainKemonoJson

type KemonoPostToDl

type KemonoPostToDl struct {
	Service   string
	CreatorId string
	PostId    string
}

func ProcessPostUrls

func ProcessPostUrls(postUrls []string) []*KemonoPostToDl

type MainKemonoJson

type MainKemonoJson struct {
	Added       string `json:"added"`
	Attachments []struct {
		Name string `json:"name"`
		Path string `json:"path"`
	} `json:"attachments"`
	Content string `json:"content"`
	Edited  string `json:"edited"`
	Embed   struct {
		Description string `json:"description"`
		Subject     string `json:"subject"`
		Url         string `json:"url"`
	} `json:"embed"`
	File struct {
		// usually is for the post thumbnail
		Name string `json:"name"`
		Path string `json:"path"`
	} `json:"file"`
	Id         string `json:"id"`
	Published  string `json:"published"`
	Service    string `json:"service"`
	SharedFile bool   `json:"shared_file"`
	Title      string `json:"title"`
	User       string `json:"user"` // creator id
}

Jump to

Keyboard shortcuts

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