Documentation ¶
Index ¶
- func DlFantiaPost(count, maxCount int, postId string, dlOptions *FantiaDlOptions) ([]*httpfuncs.ToDownload, error)
- type FantiaContent
- type FantiaDl
- type FantiaDlOptions
- func (f *FantiaDlOptions) Cancel()
- func (f *FantiaDlOptions) GetAutoSolveCaptcha() bool
- func (f *FantiaDlOptions) GetCancel() context.CancelFunc
- func (f *FantiaDlOptions) GetCaptchaHandler() constants.CAPTCHA_FN
- func (f *FantiaDlOptions) GetCaptchaSolverProgBar() progress.Progress
- func (f *FantiaDlOptions) GetConfigs() *configs.Config
- func (f *FantiaDlOptions) GetContext() context.Context
- func (f *FantiaDlOptions) GetCsrfToken(userAgent string) error
- func (f *FantiaDlOptions) GetNotifier() notify.Notifier
- func (f *FantiaDlOptions) GetSessionCookies() []*http.Cookie
- func (f *FantiaDlOptions) SetAutoSolveCaptcha(autoSolveCaptcha bool)
- func (f *FantiaDlOptions) SetContext(ctx context.Context)
- func (f *FantiaDlOptions) ValidateArgs(userAgent string) error
- type FantiaPost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DlFantiaPost ¶
func DlFantiaPost(count, maxCount int, postId string, dlOptions *FantiaDlOptions) ([]*httpfuncs.ToDownload, error)
Types ¶
type FantiaContent ¶
type FantiaContent struct { // Any attachments such as pdfs that are on their dedicated section AttachmentURI string `json:"attachment_uri"` // For images that are uploaded to their own section PostContentPhotos []struct { ID int `json:"id"` URL struct { Original string `json:"original"` } `json:"url"` } `json:"post_content_photos"` // For images that are embedded in the post content blocks. // Could also contain links to other external file hosting providers. Comment string `json:"comment"` // for attachments such as pdfs that are embedded in the post content DownloadUri string `json:"download_uri"` Filename string `json:"filename"` }
type FantiaDl ¶
FantiaDl is the struct that contains the IDs of the Fantia fanclubs and posts to download.
func (*FantiaDl) DlFantiaPosts ¶
func (f *FantiaDl) DlFantiaPosts(dlOptions *FantiaDlOptions) []*httpfuncs.ToDownload
Query Fantia's API based on the slice of post IDs and get a map of urls to download from.
Note that only the downloading of the URL(s) is/are executed concurrently to reduce the chance of the signed AWS S3 URL(s) from expiring before the download is executed or completed due to a download queue to avoid resource exhaustion of the user's system.
func (*FantiaDl) GetCreatorsPosts ¶
func (f *FantiaDl) GetCreatorsPosts(dlOptions *FantiaDlOptions)
Retrieves all the posts based on the slice of creator IDs and updates its PostIds slice
func (*FantiaDl) ValidateArgs ¶
func (f *FantiaDl) ValidateArgs()
ValidateArgs validates the IDs of the Fantia fanclubs and posts to download.
It also validates the page numbers of the fanclubs to download.
Should be called after initialising the struct.
type FantiaDlOptions ¶
type FantiaDlOptions struct { DlThumbnails bool DlImages bool DlAttachments bool DlGdrive bool AutoSolveCaptcha bool // whether to use chromedp to solve reCAPTCHA automatically GdriveClient *gdrive.GDrive Configs *configs.Config SessionCookieId string SessionCookies []*http.Cookie CsrfToken string Notifier notify.Notifier // Progress indicators CaptchaSolverProgBar progress.Progress PostProgBar progress.Progress GetFanclubPostsProgBar progress.Progress ProcessJsonProgBar progress.Progress GdriveApiProgBar progress.Progress GdriveDlProgBar progress.Progress // contains filtered or unexported fields }
FantiaDlOptions is the struct that contains the options for downloading from Fantia.
func (*FantiaDlOptions) Cancel ¶
func (f *FantiaDlOptions) Cancel()
Cancel cancels the context of the FantiaDlOptions struct.
func (*FantiaDlOptions) GetAutoSolveCaptcha ¶
func (f *FantiaDlOptions) GetAutoSolveCaptcha() bool
func (*FantiaDlOptions) GetCancel ¶
func (f *FantiaDlOptions) GetCancel() context.CancelFunc
func (*FantiaDlOptions) GetCaptchaHandler ¶
func (f *FantiaDlOptions) GetCaptchaHandler() constants.CAPTCHA_FN
func (*FantiaDlOptions) GetCaptchaSolverProgBar ¶
func (f *FantiaDlOptions) GetCaptchaSolverProgBar() progress.Progress
func (*FantiaDlOptions) GetConfigs ¶
func (f *FantiaDlOptions) GetConfigs() *configs.Config
func (*FantiaDlOptions) GetContext ¶
func (f *FantiaDlOptions) GetContext() context.Context
func (*FantiaDlOptions) GetCsrfToken ¶
func (f *FantiaDlOptions) GetCsrfToken(userAgent string) error
GetCsrfToken gets the CSRF token from Fantia's index HTML which is required to communicate with their API.
func (*FantiaDlOptions) GetNotifier ¶
func (f *FantiaDlOptions) GetNotifier() notify.Notifier
func (*FantiaDlOptions) GetSessionCookies ¶
func (f *FantiaDlOptions) GetSessionCookies() []*http.Cookie
func (*FantiaDlOptions) SetAutoSolveCaptcha ¶
func (f *FantiaDlOptions) SetAutoSolveCaptcha(autoSolveCaptcha bool)
func (*FantiaDlOptions) SetContext ¶
func (f *FantiaDlOptions) SetContext(ctx context.Context)
func (*FantiaDlOptions) ValidateArgs ¶
func (f *FantiaDlOptions) ValidateArgs(userAgent string) error
ValidateArgs validates the options for downloading from Fantia.
Should be called after initialising the struct.
type FantiaPost ¶
type FantiaPost struct { Post struct { ID int `json:"id"` Comment string `json:"comment"` // the main post content Title string `json:"title"` Thumb struct { Original string `json:"original"` } `json:"thumb"` Fanclub struct { User struct { Name string `json:"name"` } `json:"user"` } `json:"fanclub"` Status string `json:"status"` PostContents []FantiaContent `json:"post_contents"` } `json:"post"` Redirect string `json:"redirect"` // if get flagged by the system, it will redirect to this recaptcha url }