Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HostMapping = map[string]string{
"ibb.co": "imgbb",
"pixhost.cc": "pixhost",
"pixhost.to": "pixhost",
"imgbox.com": "imgbox",
"beyondhd.co": "bhd",
"imagebam.com": "bam",
"onlyimage.org": "onlyimage",
"ptscreens.com": "ptscreens",
"img.passtheima.ge": "passtheimage",
"imgur.com": "imgur",
"postimg.cc": "postimg",
"samaritano.cc": "samaritano",
"digitalcore.club": "sharex",
"img.digitalcore.club": "sharex",
"kshare.club": "kshare",
"img.pterclub.com": "pterclub",
"s3.pterclub.com": "pterclub",
"yes.ilikeshots.club": "ilikeshots",
"imgbox": "imgbox",
"i.ibb.co": "imgbb",
}
HostMapping is the process-wide URL-host normalization table used by ExtractHost. Treat it as read-only after startup; ExtractHost reads it without synchronization.
Functions ¶
func DirectImageURL ¶ added in v0.4.0
DirectImageURL returns the full-size source URL, or empty for an unusable wsrv proxy.
func ExtractHost ¶
ExtractHost returns the mapped image-host name for a URL, checking the exact lowercased host, a removed "www." prefix, and the final two labels in that order. Invalid or hostless URLs return empty; unmatched hosts are returned as lowercased URL hosts.
func IsSourceOnlyURL ¶ added in v0.4.0
IsSourceOnlyURL reports image URLs that may be downloaded but cannot be reused as hosted links on another tracker.
func IsWsrvProxyURL ¶ added in v0.4.0
IsWsrvProxyURL reports whether value points at a known wsrv image proxy.
func NormalizeRawURL ¶ added in v0.4.0
NormalizeRawURL expands supported thumbnail, viewer, and proxy URLs to direct full-size images.
func WsrvSourceURL ¶ added in v0.4.0
WsrvSourceURL returns the URL carried by a known image proxy, if present.
Types ¶
This section is empty.