Documentation ¶
Overview ¶
Package bunkr contains functions that can be used to accurately extract and validate Bunkr links.
Index ¶
- func Convert(res string) string
- func Delegate(res, source string) ([]models.Entry, error)
- func Extract(res string) ([]string, error)
- func ExtractFileCount(bunkrContents string) int
- func ExtractSize(bunkrContents string) string
- func ExtractThumbnail(bunkrContents string) string
- func ExtractTitle(bunkrContents string) string
- func ExtractViewCount(albumUrl string) (int, error)
- func Validate(x string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert takes a bunkr link in string format as an argument and converts the domain to one that is currently active (bunkrr.su right now). Result returned in string format
func Delegate ¶
Delegate takes a string as an argument and returns a slice of valid Bunkr links found within the response (if any) or nil, and an error
func ExtractFileCount ¶
ExtractFileCount takes the body response/contents of a Bunkr page (raw source/html (formatted as string)) as an argument and returns the album's file count as an integer. It will return -1 in the case of a syntax error.
func ExtractSize ¶
ExtractSize takes the body response/contents of a Bunkr page (raw source/html (formatted as string)) as an argument and returns the album's total/cumulative file size as a string.
func ExtractThumbnail ¶
ExtractThumbnail takes the body response/contents of a Bunkr page (raw source/html (formatted as string)) as an argument. Bunkr albums do not have a dedicated thumbnail, so ExtractThumbnail() instead extracts the first image URL it finds, as this can grant more insight if other metadata is misleading/inconclusive. The extracted URL is unescaped to ensure validity and returned in string format.
func ExtractTitle ¶
ExtractTitle takes the body response/contents of a Bunkr page (raw source/html (formatted as string)) as an argument and returns the album's title as a string.
func ExtractViewCount ¶
ExtractViewCount uses the Bunkr API (https://slut.bunkr.ru/slutsCount?pageUrl=${pageUrl}) to get view count. It takes a bunkr album link as an argument (in string format) and returns a string containing the view count, alongside an error. The error will be nil if everything is successful. If a failure occurs, -1 will be returned.
Types ¶
This section is empty.