user

package
v0.0.0-...-d6f4979 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCharacterFromMD5

func FindCharacterFromMD5(md5 string) (string, error)

FindCharacterFromMD5 will attempt to locate the Captcha MD5 in the existing MD5 slices. Returns the character name or unknown and an error if not found.

func GetCookieFromEaGate

func GetCookieFromEaGate(username string, password string, otp string, client util.EaClient) (*http.Cookie, error)

GetCookieFromEaGate will submit a request to login as the given username with the provided password and optionally, otp.

func GetMD5FromImageData

func GetMD5FromImageData(imageData []byte) []byte

GetMD5FromImageData

func LoadImageDataFromUri

func LoadImageDataFromUri(uri string) ([]byte, error)

LoadMD5OfImageURI will attempt to Get an image from the provided URI, and calculate the MD5 checksum of this image. Returns the MD5 checksum as a string and an error if the process fails.

func SolveCaptcha

func SolveCaptcha(captchaData Captcha) (session string, correct string, err error)

SolveCaptcha will load a Konami Captcha and attempt to solve it. It returns a string containing the captcha session, a slice containing all correct keys, and any errors encountered.

Types

type Captcha

type Captcha struct {
	Data struct {
		CorrectPic string `json:"correct_pic"`
		Kcsess     string `json:"kcsess"`
		ChoiceList []struct {
			Attr   string `json:"attr"`
			ImgURL string `json:"img_url"`
			Key    string `json:"key"`
		} `json:"choicelist"`
	} `json:"data"`
}

Captcha defines Konami Captcha JSON

func LoadCaptchaData

func LoadCaptchaData(client util.EaClient) (captchaData Captcha, err error)

Jump to

Keyboard shortcuts

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