util

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var R = regexp.MustCompile(`}\('(.+?)',(\d+),(\d+),'(.+?)'\.split\('\|'\),0,{}\)\)`)
View Source
var UserAgents = []string{
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/101.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/100.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/99.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/98.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/97.0",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/96.0",
}

Functions

func Archive added in v1.30.1

func Archive(src, dst string) error

func AsFilename added in v1.34.0

func AsFilename(s string) string

func Body added in v1.35.0

func Body(r *http.Request, c *http.Client) (io.ReadCloser, error)

func Decode1 added in v1.27.0

func Decode1(p string, a, c int, k []string) string

func Decode2 added in v1.27.0

func Decode2(s string) string

func Decode3 added in v1.27.0

func Decode3(s string) string

func Decode4 added in v1.30.3

func Decode4(s string, dst *[]string) int

func Decode5 added in v1.30.3

func Decode5(s string) (int, string)

func Decode6 added in v1.33.2

func Decode6(m []string) string

func Html added in v1.35.0

func Html(r *http.Request, c *http.Client) (*goquery.Document, error)

func HtmlGBK added in v1.35.0

func HtmlGBK(r *http.Request, c *http.Client) (*goquery.Document, error)

func Origin added in v1.30.3

func Origin(href string) string

func RandUA

func RandUA() string

func Request added in v1.32.0

func Request(url string) *http.Request

func Response added in v1.35.0

func Response(r *http.Request, c *http.Client) (*http.Response, error)

func Reverse

func Reverse[S ~[]E, E any](a S)

func Text added in v1.35.0

func Text(r *http.Request, c *http.Client) (string, error)

Types

type Limiter added in v1.32.0

type Limiter struct {
	// contains filtered or unexported fields
}

func NewLimiter added in v1.32.0

func NewLimiter(n uint, d time.Duration) *Limiter

func (*Limiter) Acquire added in v1.32.0

func (lim *Limiter) Acquire()

Jump to

Keyboard shortcuts

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