Documentation ¶
Index ¶
- Constants
- Variables
- func GetFavourites(downloadPath string, dlOptions *KemonoDlOptions) ([]*httpfuncs.ToDownload, []*httpfuncs.ToDownload, error)
- func GetMultipleCreators(creators []*KemonoCreatorToDl, downloadPath string, dlOptions *KemonoDlOptions) ([]*httpfuncs.ToDownload, []*httpfuncs.ToDownload)
- func GetMultiplePosts(posts []*KemonoPostToDl, downloadPath string, dlOptions *KemonoDlOptions) ([]*httpfuncs.ToDownload, []*httpfuncs.ToDownload)
- type KemonoCreatorToDl
- type KemonoDl
- type KemonoDlOptions
- type KemonoFavCreatorJson
- type KemonoJson
- type KemonoPostToDl
- type MainKemonoJson
Constants ¶
View Source
const ( BASE_REGEX_STR = `` /* 142-byte string literal not displayed */ BASE_POST_SUFFIX_REGEX_STR = `/post/(?P<postId>\d+)` TLD_GROUP_NAME = "topLevelDomain" SERVICE_GROUP_NAME = "service" CREATOR_ID_GROUP_NAME = "creatorId" POST_ID_GROUP_NAME = "postId" API_MAX_CONCURRENT = 3 )
Variables ¶
View Source
var ( POST_URL_REGEX = regexp.MustCompile( fmt.Sprintf( `^%s%s$`, BASE_REGEX_STR, BASE_POST_SUFFIX_REGEX_STR, ), ) POST_URL_REGEX_TLD_INDEX = POST_URL_REGEX.SubexpIndex(TLD_GROUP_NAME) POST_URL_REGEX_SERVICE_INDEX = POST_URL_REGEX.SubexpIndex(SERVICE_GROUP_NAME) POST_URL_REGEX_CREATOR_ID_INDEX = POST_URL_REGEX.SubexpIndex(CREATOR_ID_GROUP_NAME) POST_URL_REGEX_POST_ID_INDEX = POST_URL_REGEX.SubexpIndex(POST_ID_GROUP_NAME) CREATOR_URL_REGEX = regexp.MustCompile( fmt.Sprintf( `^%s$`, BASE_REGEX_STR, ), ) CREATOR_URL_REGEX_TLD_INDEX = CREATOR_URL_REGEX.SubexpIndex(TLD_GROUP_NAME) CREATOR_URL_REGEX_SERVICE_INDEX = CREATOR_URL_REGEX.SubexpIndex(SERVICE_GROUP_NAME) CREATOR_URL_REGEX_CREATOR_ID_INDEX = CREATOR_URL_REGEX.SubexpIndex(CREATOR_ID_GROUP_NAME) )
Functions ¶
func GetFavourites ¶
func GetFavourites(downloadPath string, dlOptions *KemonoDlOptions) ([]*httpfuncs.ToDownload, []*httpfuncs.ToDownload, error)
func GetMultipleCreators ¶
func GetMultipleCreators(creators []*KemonoCreatorToDl, downloadPath string, dlOptions *KemonoDlOptions) ([]*httpfuncs.ToDownload, []*httpfuncs.ToDownload)
func GetMultiplePosts ¶
func GetMultiplePosts(posts []*KemonoPostToDl, downloadPath string, dlOptions *KemonoDlOptions) ([]*httpfuncs.ToDownload, []*httpfuncs.ToDownload)
Types ¶
type KemonoCreatorToDl ¶
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 ¶
type KemonoDlOptions ¶
type KemonoDlOptions struct { DlAttachments bool DlGdrive bool 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 // Prog bars PostProgBar progress.Progress GetCreatorPostProgBar progress.Progress ProcessJsonProgBar progress.Progress GetFavouritesPostProgBar progress.Progress GdriveApiProgBar progress.Progress GdriveDlProgBar progress.Progress // contains filtered or unexported fields }
KemonoDlOptions is the struct that contains the arguments for Kemono download options.
func (*KemonoDlOptions) Cancel ¶
func (k *KemonoDlOptions) Cancel()
Cancel cancels the context of the KemonoDlOptions struct.
func (*KemonoDlOptions) GetCancel ¶
func (k *KemonoDlOptions) GetCancel() context.CancelFunc
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 KemonoJson ¶
type KemonoJson []*MainKemonoJson
type KemonoPostToDl ¶
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"` Title string `json:"title"` User string `json:"user"` // creator id }
Click to show internal directories.
Click to hide internal directories.