host

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func DirectImageURL(value string) string

DirectImageURL returns the full-size source URL, or empty for an unusable wsrv proxy.

func ExtractHost

func ExtractHost(rawURL string) string

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

func IsSourceOnlyURL(value string) bool

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

func IsWsrvProxyURL(value string) bool

IsWsrvProxyURL reports whether value points at a known wsrv image proxy.

func NormalizeRawURL added in v0.4.0

func NormalizeRawURL(value string) string

NormalizeRawURL expands supported thumbnail, viewer, and proxy URLs to direct full-size images.

func WsrvSourceURL added in v0.4.0

func WsrvSourceURL(value string) string

WsrvSourceURL returns the URL carried by a known image proxy, if present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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